@google/genai 1.30.0 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/genai.d.ts CHANGED
@@ -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.
@@ -3740,6 +3734,7 @@ export declare class GoogleGenAI {
3740
3734
  private readonly apiKey?;
3741
3735
  readonly vertexai: boolean;
3742
3736
  private readonly apiVersion?;
3737
+ private readonly httpOptions?;
3743
3738
  readonly models: Models;
3744
3739
  readonly live: Live;
3745
3740
  readonly batches: Batches;
@@ -7775,25 +7770,30 @@ declare class Tunings extends BaseModule {
7775
7770
  private readonly apiClient;
7776
7771
  constructor(apiClient: ApiClient);
7777
7772
  /**
7778
- * Gets a TuningJob.
7773
+ * Lists tuning jobs.
7779
7774
  *
7780
- * @param name - The resource name of the tuning job.
7781
- * @return - A TuningJob object.
7775
+ * @param params - The parameters for the list request.
7776
+ * @return - A pager of tuning jobs.
7782
7777
  *
7783
- * @experimental - The SDK's tuning implementation is experimental, and may
7784
- * change in future versions.
7778
+ * @example
7779
+ * ```ts
7780
+ * const tuningJobs = await ai.tunings.list({config: {'pageSize': 2}});
7781
+ * for await (const tuningJob of tuningJobs) {
7782
+ * console.log(tuningJob);
7783
+ * }
7784
+ * ```
7785
7785
  */
7786
- get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
7786
+ list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
7787
7787
  /**
7788
- * Lists tuning jobs.
7788
+ * Gets a TuningJob.
7789
7789
  *
7790
- * @param config - The configuration for the list request.
7791
- * @return - A list of tuning jobs.
7790
+ * @param name - The resource name of the tuning job.
7791
+ * @return - A TuningJob object.
7792
7792
  *
7793
7793
  * @experimental - The SDK's tuning implementation is experimental, and may
7794
7794
  * change in future versions.
7795
7795
  */
7796
- list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
7796
+ get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
7797
7797
  /**
7798
7798
  * Creates a supervised fine-tuning job.
7799
7799
  *
@@ -7817,7 +7817,7 @@ declare class Tunings extends BaseModule {
7817
7817
  * await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
7818
7818
  * ```
7819
7819
  */
7820
- cancel(params: types.CancelTuningJobParameters): Promise<void>;
7820
+ cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
7821
7821
  private tuneInternal;
7822
7822
  private tuneMldevInternal;
7823
7823
  }
@@ -8185,6 +8185,7 @@ declare namespace types {
8185
8185
  ListTuningJobsResponse,
8186
8186
  CancelTuningJobConfig,
8187
8187
  CancelTuningJobParameters,
8188
+ CancelTuningJobResponse,
8188
8189
  TuningExample,
8189
8190
  TuningDataset,
8190
8191
  TuningValidationDataset,