@google/genai 1.30.0 → 1.32.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.
@@ -436,6 +436,21 @@ export declare interface BaseUrlParameters {
436
436
  export declare class Batches extends BaseModule {
437
437
  private readonly apiClient;
438
438
  constructor(apiClient: ApiClient);
439
+ /**
440
+ * Lists batch jobs.
441
+ *
442
+ * @param params - The parameters for the list request.
443
+ * @return - A pager of batch jobs.
444
+ *
445
+ * @example
446
+ * ```ts
447
+ * const batchJobs = await ai.batches.list({config: {'pageSize': 2}});
448
+ * for await (const batchJob of batchJobs) {
449
+ * console.log(batchJob);
450
+ * }
451
+ * ```
452
+ */
453
+ list: (params?: types.ListBatchJobsParameters) => Promise<Pager<types.BatchJob>>;
439
454
  /**
440
455
  * Create batch job.
441
456
  *
@@ -471,21 +486,6 @@ export declare class Batches extends BaseModule {
471
486
  * ```
472
487
  */
473
488
  createEmbeddings: (params: types.CreateEmbeddingsBatchJobParameters) => Promise<types.BatchJob>;
474
- /**
475
- * Lists batch job configurations.
476
- *
477
- * @param params - The parameters for the list request.
478
- * @return The paginated results of the list of batch jobs.
479
- *
480
- * @example
481
- * ```ts
482
- * const batchJobs = await ai.batches.list({config: {'pageSize': 2}});
483
- * for await (const batchJob of batchJobs) {
484
- * console.log(batchJob);
485
- * }
486
- * ```
487
- */
488
- list: (params?: types.ListBatchJobsParameters) => Promise<Pager<types.BatchJob>>;
489
489
  private createInlinedGenerateContentRequest;
490
490
  private getGcsUri;
491
491
  private getBigqueryUri;
@@ -741,10 +741,10 @@ export declare class Caches extends BaseModule {
741
741
  private readonly apiClient;
742
742
  constructor(apiClient: ApiClient);
743
743
  /**
744
- * Lists cached content configurations.
744
+ * Lists cached contents.
745
745
  *
746
746
  * @param params - The parameters for the list request.
747
- * @return The paginated results of the list of cached contents.
747
+ * @return - A pager of cached contents.
748
748
  *
749
749
  * @example
750
750
  * ```ts
@@ -900,6 +900,12 @@ export declare interface CancelTuningJobParameters {
900
900
  config?: CancelTuningJobConfig;
901
901
  }
902
902
 
903
+ /** Empty response for tunings.cancel method. */
904
+ export declare class CancelTuningJobResponse {
905
+ /** Used to retain the full HTTP response. */
906
+ sdkHttpResponse?: HttpResponse;
907
+ }
908
+
903
909
  /** A response candidate generated from the model. */
904
910
  export declare interface Candidate {
905
911
  /** Contains the multi-part content of the response.
@@ -1922,7 +1928,7 @@ declare class Documents extends BaseModule {
1922
1928
  *
1923
1929
  * @example
1924
1930
  * ```ts
1925
- * const documents = await ai.documents.list({config: {'pageSize': 2}});
1931
+ * const documents = await ai.documents.list({parent:'rag_store_name', config: {'pageSize': 2}});
1926
1932
  * for await (const document of documents) {
1927
1933
  * console.log(document);
1928
1934
  * }
@@ -1942,12 +1948,6 @@ declare class Documents extends BaseModule {
1942
1948
  * @param params - The parameters for deleting a document.
1943
1949
  */
1944
1950
  delete(params: types.DeleteDocumentParameters): Promise<void>;
1945
- /**
1946
- * Lists all Documents in a FileSearchStore.
1947
- *
1948
- * @param params - The parameters for listing documents.
1949
- * @return ListDocumentsResponse.
1950
- */
1951
1951
  private listInternal;
1952
1952
  }
1953
1953
 
@@ -2362,19 +2362,16 @@ export declare class Files extends BaseModule {
2362
2362
  private readonly apiClient;
2363
2363
  constructor(apiClient: ApiClient);
2364
2364
  /**
2365
- * Lists all current project files from the service.
2365
+ * Lists files.
2366
2366
  *
2367
- * @param params - The parameters for the list request
2368
- * @return The paginated results of the list of files
2367
+ * @param params - The parameters for the list request.
2368
+ * @return - A pager of files.
2369
2369
  *
2370
2370
  * @example
2371
- * The following code prints the names of all files from the service, the
2372
- * size of each page is 10.
2373
- *
2374
2371
  * ```ts
2375
- * const listResponse = await ai.files.list({config: {'pageSize': 10}});
2376
- * for await (const file of listResponse) {
2377
- * console.log(file.name);
2372
+ * const files = await ai.files.list({config: {'pageSize': 2}});
2373
+ * for await (const file of files) {
2374
+ * console.log(file);
2378
2375
  * }
2379
2376
  * ```
2380
2377
  */
@@ -2510,6 +2507,21 @@ declare class FileSearchStores extends BaseModule {
2510
2507
  private readonly apiClient;
2511
2508
  readonly documents: Documents;
2512
2509
  constructor(apiClient: ApiClient, documents?: Documents);
2510
+ /**
2511
+ * Lists file search stores.
2512
+ *
2513
+ * @param params - The parameters for the list request.
2514
+ * @return - A pager of file search stores.
2515
+ *
2516
+ * @example
2517
+ * ```ts
2518
+ * const fileSearchStores = await ai.fileSearchStores.list({config: {'pageSize': 2}});
2519
+ * for await (const fileSearchStore of fileSearchStores) {
2520
+ * console.log(fileSearchStore);
2521
+ * }
2522
+ * ```
2523
+ */
2524
+ list: (params?: types.ListFileSearchStoresParameters) => Promise<Pager<types.FileSearchStore>>;
2513
2525
  /**
2514
2526
  * Uploads a file asynchronously to a given File Search Store.
2515
2527
  * This method is not available in Vertex AI.
@@ -2547,21 +2559,6 @@ declare class FileSearchStores extends BaseModule {
2547
2559
  * ```
2548
2560
  */
2549
2561
  uploadToFileSearchStore(params: types.UploadToFileSearchStoreParameters): Promise<types.UploadToFileSearchStoreOperation>;
2550
- /**
2551
- * Lists file search stores.
2552
- *
2553
- * @param params - The parameters for the list request.
2554
- * @return - A pager of file search stores.
2555
- *
2556
- * @example
2557
- * ```ts
2558
- * const fileSearchStores = await ai.fileSearchStores.list({config: {'pageSize': 2}});
2559
- * for await (const fileSearchStore of fileSearchStores) {
2560
- * console.log(fileSearchStore);
2561
- * }
2562
- * ```
2563
- */
2564
- list: (params?: types.ListFileSearchStoresParameters) => Promise<Pager<types.FileSearchStore>>;
2565
2562
  /**
2566
2563
  * Creates a File Search Store.
2567
2564
  *
@@ -2582,12 +2579,6 @@ declare class FileSearchStores extends BaseModule {
2582
2579
  * @param params - The parameters for deleting a File Search Store.
2583
2580
  */
2584
2581
  delete(params: types.DeleteFileSearchStoreParameters): Promise<void>;
2585
- /**
2586
- * Lists all FileSearchStore owned by the user.
2587
- *
2588
- * @param params - The parameters for listing file search stores.
2589
- * @return ListFileSearchStoresResponse.
2590
- */
2591
2582
  private listInternal;
2592
2583
  private uploadToFileSearchStoreInternal;
2593
2584
  /**
@@ -2959,6 +2950,9 @@ export declare interface GenerateContentConfig {
2959
2950
  object](https://spec.openapis.org/oas/v3.0.3#schema).
2960
2951
  If set, a compatible response_mime_type must also be set.
2961
2952
  Compatible mimetypes: `application/json`: Schema for JSON response.
2953
+
2954
+ If `response_schema` doesn't process your schema correctly, try using
2955
+ `response_json_schema` instead.
2962
2956
  */
2963
2957
  responseSchema?: SchemaUnion;
2964
2958
  /** Optional. Output schema of the generated response.
@@ -3023,6 +3017,10 @@ export declare interface GenerateContentConfig {
3023
3017
  /** The image generation configuration.
3024
3018
  */
3025
3019
  imageConfig?: ImageConfig;
3020
+ /** Enables enhanced civic answers. It may not be available for all
3021
+ models. This field is not supported in Vertex AI.
3022
+ */
3023
+ enableEnhancedCivicAnswers?: boolean;
3026
3024
  }
3027
3025
 
3028
3026
  /** Config for models.generate_content parameters. */
@@ -3752,6 +3750,7 @@ export declare class GoogleGenAI {
3752
3750
  private readonly project?;
3753
3751
  private readonly location?;
3754
3752
  private readonly apiVersion?;
3753
+ private readonly httpOptions?;
3755
3754
  readonly models: Models;
3756
3755
  readonly live: Live;
3757
3756
  readonly batches: Batches;
@@ -6716,6 +6715,17 @@ export declare class ReplayResponse {
6716
6715
  sdkResponseSegments?: Record<string, unknown>[];
6717
6716
  }
6718
6717
 
6718
+ /** ReplicatedVoiceConfig is used to configure replicated voice. */
6719
+ export declare interface ReplicatedVoiceConfig {
6720
+ /** The mime type of the replicated voice.
6721
+ */
6722
+ mimeType?: string;
6723
+ /** The sample audio of the replicated voice.
6724
+
6725
+ * @remarks Encoded as base64 string. */
6726
+ voiceSampleAudio?: string;
6727
+ }
6728
+
6719
6729
  /** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
6720
6730
  export declare interface Retrieval {
6721
6731
  /** Optional. Deprecated. This option is no longer supported. */
@@ -7206,12 +7216,11 @@ export declare interface SpeakerVoiceConfig {
7206
7216
  voiceConfig?: VoiceConfig;
7207
7217
  }
7208
7218
 
7209
- /** The speech generation config. */
7210
7219
  export declare interface SpeechConfig {
7220
+ /** Configuration for the voice of the response. */
7221
+ voiceConfig?: VoiceConfig;
7211
7222
  /** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
7212
7223
  languageCode?: string;
7213
- /** The configuration for the speaker to use. */
7214
- voiceConfig?: VoiceConfig;
7215
7224
  /** Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI. */
7216
7225
  multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
7217
7226
  }
@@ -7787,25 +7796,30 @@ declare class Tunings extends BaseModule {
7787
7796
  private readonly apiClient;
7788
7797
  constructor(apiClient: ApiClient);
7789
7798
  /**
7790
- * Gets a TuningJob.
7799
+ * Lists tuning jobs.
7791
7800
  *
7792
- * @param name - The resource name of the tuning job.
7793
- * @return - A TuningJob object.
7801
+ * @param params - The parameters for the list request.
7802
+ * @return - A pager of tuning jobs.
7794
7803
  *
7795
- * @experimental - The SDK's tuning implementation is experimental, and may
7796
- * change in future versions.
7804
+ * @example
7805
+ * ```ts
7806
+ * const tuningJobs = await ai.tunings.list({config: {'pageSize': 2}});
7807
+ * for await (const tuningJob of tuningJobs) {
7808
+ * console.log(tuningJob);
7809
+ * }
7810
+ * ```
7797
7811
  */
7798
- get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
7812
+ list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
7799
7813
  /**
7800
- * Lists tuning jobs.
7814
+ * Gets a TuningJob.
7801
7815
  *
7802
- * @param config - The configuration for the list request.
7803
- * @return - A list of tuning jobs.
7816
+ * @param name - The resource name of the tuning job.
7817
+ * @return - A TuningJob object.
7804
7818
  *
7805
7819
  * @experimental - The SDK's tuning implementation is experimental, and may
7806
7820
  * change in future versions.
7807
7821
  */
7808
- list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
7822
+ get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
7809
7823
  /**
7810
7824
  * Creates a supervised fine-tuning job.
7811
7825
  *
@@ -7829,7 +7843,7 @@ declare class Tunings extends BaseModule {
7829
7843
  * await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
7830
7844
  * ```
7831
7845
  */
7832
- cancel(params: types.CancelTuningJobParameters): Promise<void>;
7846
+ cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
7833
7847
  private tuneInternal;
7834
7848
  private tuneMldevInternal;
7835
7849
  }
@@ -8056,6 +8070,12 @@ declare namespace types {
8056
8070
  LatLng,
8057
8071
  RetrievalConfig,
8058
8072
  ToolConfig,
8073
+ ReplicatedVoiceConfig,
8074
+ PrebuiltVoiceConfig,
8075
+ VoiceConfig,
8076
+ SpeakerVoiceConfig,
8077
+ MultiSpeakerVoiceConfig,
8078
+ SpeechConfig,
8059
8079
  AutomaticFunctionCallingConfig,
8060
8080
  ThinkingConfig,
8061
8081
  ImageConfig,
@@ -8143,11 +8163,6 @@ declare namespace types {
8143
8163
  DeleteModelConfig,
8144
8164
  DeleteModelParameters,
8145
8165
  DeleteModelResponse,
8146
- PrebuiltVoiceConfig,
8147
- VoiceConfig,
8148
- SpeakerVoiceConfig,
8149
- MultiSpeakerVoiceConfig,
8150
- SpeechConfig,
8151
8166
  GenerationConfig,
8152
8167
  CountTokensConfig,
8153
8168
  CountTokensParameters,
@@ -8197,6 +8212,7 @@ declare namespace types {
8197
8212
  ListTuningJobsResponse,
8198
8213
  CancelTuningJobConfig,
8199
8214
  CancelTuningJobParameters,
8215
+ CancelTuningJobResponse,
8200
8216
  TuningExample,
8201
8217
  TuningDataset,
8202
8218
  TuningValidationDataset,
@@ -8855,8 +8871,9 @@ export declare interface VideoMetadata {
8855
8871
  startOffset?: string;
8856
8872
  }
8857
8873
 
8858
- /** The configuration for the voice to use. */
8859
8874
  export declare interface VoiceConfig {
8875
+ /** If true, the model will use a replicated voice for the response. */
8876
+ replicatedVoiceConfig?: ReplicatedVoiceConfig;
8860
8877
  /** The configuration for the prebuilt voice to use. */
8861
8878
  prebuiltVoiceConfig?: PrebuiltVoiceConfig;
8862
8879
  }