@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.
- package/dist/genai.d.ts +91 -74
- package/dist/index.cjs +1343 -1265
- package/dist/index.mjs +1343 -1266
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +3159 -3081
- package/dist/node/index.mjs +3159 -3082
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +91 -74
- package/dist/web/index.mjs +3159 -3082
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +91 -74
- package/package.json +8 -7
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
|
|
744
|
+
* Lists cached contents.
|
|
745
745
|
*
|
|
746
746
|
* @param params - The parameters for the list request.
|
|
747
|
-
* @return
|
|
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
|
|
2365
|
+
* Lists files.
|
|
2366
2366
|
*
|
|
2367
|
-
* @param params - The parameters for the list request
|
|
2368
|
-
* @return
|
|
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
|
|
2376
|
-
* for await (const file of
|
|
2377
|
-
* console.log(file
|
|
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. */
|
|
@@ -3740,6 +3738,7 @@ export declare class GoogleGenAI {
|
|
|
3740
3738
|
private readonly apiKey?;
|
|
3741
3739
|
readonly vertexai: boolean;
|
|
3742
3740
|
private readonly apiVersion?;
|
|
3741
|
+
private readonly httpOptions?;
|
|
3743
3742
|
readonly models: Models;
|
|
3744
3743
|
readonly live: Live;
|
|
3745
3744
|
readonly batches: Batches;
|
|
@@ -6704,6 +6703,17 @@ export declare class ReplayResponse {
|
|
|
6704
6703
|
sdkResponseSegments?: Record<string, unknown>[];
|
|
6705
6704
|
}
|
|
6706
6705
|
|
|
6706
|
+
/** ReplicatedVoiceConfig is used to configure replicated voice. */
|
|
6707
|
+
export declare interface ReplicatedVoiceConfig {
|
|
6708
|
+
/** The mime type of the replicated voice.
|
|
6709
|
+
*/
|
|
6710
|
+
mimeType?: string;
|
|
6711
|
+
/** The sample audio of the replicated voice.
|
|
6712
|
+
|
|
6713
|
+
* @remarks Encoded as base64 string. */
|
|
6714
|
+
voiceSampleAudio?: string;
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6707
6717
|
/** Defines a retrieval tool that model can call to access external knowledge. This data type is not supported in Gemini API. */
|
|
6708
6718
|
export declare interface Retrieval {
|
|
6709
6719
|
/** Optional. Deprecated. This option is no longer supported. */
|
|
@@ -7194,12 +7204,11 @@ export declare interface SpeakerVoiceConfig {
|
|
|
7194
7204
|
voiceConfig?: VoiceConfig;
|
|
7195
7205
|
}
|
|
7196
7206
|
|
|
7197
|
-
/** The speech generation config. */
|
|
7198
7207
|
export declare interface SpeechConfig {
|
|
7208
|
+
/** Configuration for the voice of the response. */
|
|
7209
|
+
voiceConfig?: VoiceConfig;
|
|
7199
7210
|
/** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
|
|
7200
7211
|
languageCode?: string;
|
|
7201
|
-
/** The configuration for the speaker to use. */
|
|
7202
|
-
voiceConfig?: VoiceConfig;
|
|
7203
7212
|
/** 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. */
|
|
7204
7213
|
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
7205
7214
|
}
|
|
@@ -7775,25 +7784,30 @@ declare class Tunings extends BaseModule {
|
|
|
7775
7784
|
private readonly apiClient;
|
|
7776
7785
|
constructor(apiClient: ApiClient);
|
|
7777
7786
|
/**
|
|
7778
|
-
*
|
|
7787
|
+
* Lists tuning jobs.
|
|
7779
7788
|
*
|
|
7780
|
-
* @param
|
|
7781
|
-
* @return - A
|
|
7789
|
+
* @param params - The parameters for the list request.
|
|
7790
|
+
* @return - A pager of tuning jobs.
|
|
7782
7791
|
*
|
|
7783
|
-
* @
|
|
7784
|
-
*
|
|
7792
|
+
* @example
|
|
7793
|
+
* ```ts
|
|
7794
|
+
* const tuningJobs = await ai.tunings.list({config: {'pageSize': 2}});
|
|
7795
|
+
* for await (const tuningJob of tuningJobs) {
|
|
7796
|
+
* console.log(tuningJob);
|
|
7797
|
+
* }
|
|
7798
|
+
* ```
|
|
7785
7799
|
*/
|
|
7786
|
-
|
|
7800
|
+
list: (params?: types.ListTuningJobsParameters) => Promise<Pager<types.TuningJob>>;
|
|
7787
7801
|
/**
|
|
7788
|
-
*
|
|
7802
|
+
* Gets a TuningJob.
|
|
7789
7803
|
*
|
|
7790
|
-
* @param
|
|
7791
|
-
* @return - A
|
|
7804
|
+
* @param name - The resource name of the tuning job.
|
|
7805
|
+
* @return - A TuningJob object.
|
|
7792
7806
|
*
|
|
7793
7807
|
* @experimental - The SDK's tuning implementation is experimental, and may
|
|
7794
7808
|
* change in future versions.
|
|
7795
7809
|
*/
|
|
7796
|
-
|
|
7810
|
+
get: (params: types.GetTuningJobParameters) => Promise<types.TuningJob>;
|
|
7797
7811
|
/**
|
|
7798
7812
|
* Creates a supervised fine-tuning job.
|
|
7799
7813
|
*
|
|
@@ -7817,7 +7831,7 @@ declare class Tunings extends BaseModule {
|
|
|
7817
7831
|
* await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
|
|
7818
7832
|
* ```
|
|
7819
7833
|
*/
|
|
7820
|
-
cancel(params: types.CancelTuningJobParameters): Promise<
|
|
7834
|
+
cancel(params: types.CancelTuningJobParameters): Promise<types.CancelTuningJobResponse>;
|
|
7821
7835
|
private tuneInternal;
|
|
7822
7836
|
private tuneMldevInternal;
|
|
7823
7837
|
}
|
|
@@ -8044,6 +8058,12 @@ declare namespace types {
|
|
|
8044
8058
|
LatLng,
|
|
8045
8059
|
RetrievalConfig,
|
|
8046
8060
|
ToolConfig,
|
|
8061
|
+
ReplicatedVoiceConfig,
|
|
8062
|
+
PrebuiltVoiceConfig,
|
|
8063
|
+
VoiceConfig,
|
|
8064
|
+
SpeakerVoiceConfig,
|
|
8065
|
+
MultiSpeakerVoiceConfig,
|
|
8066
|
+
SpeechConfig,
|
|
8047
8067
|
AutomaticFunctionCallingConfig,
|
|
8048
8068
|
ThinkingConfig,
|
|
8049
8069
|
ImageConfig,
|
|
@@ -8131,11 +8151,6 @@ declare namespace types {
|
|
|
8131
8151
|
DeleteModelConfig,
|
|
8132
8152
|
DeleteModelParameters,
|
|
8133
8153
|
DeleteModelResponse,
|
|
8134
|
-
PrebuiltVoiceConfig,
|
|
8135
|
-
VoiceConfig,
|
|
8136
|
-
SpeakerVoiceConfig,
|
|
8137
|
-
MultiSpeakerVoiceConfig,
|
|
8138
|
-
SpeechConfig,
|
|
8139
8154
|
GenerationConfig,
|
|
8140
8155
|
CountTokensConfig,
|
|
8141
8156
|
CountTokensParameters,
|
|
@@ -8185,6 +8200,7 @@ declare namespace types {
|
|
|
8185
8200
|
ListTuningJobsResponse,
|
|
8186
8201
|
CancelTuningJobConfig,
|
|
8187
8202
|
CancelTuningJobParameters,
|
|
8203
|
+
CancelTuningJobResponse,
|
|
8188
8204
|
TuningExample,
|
|
8189
8205
|
TuningDataset,
|
|
8190
8206
|
TuningValidationDataset,
|
|
@@ -8843,8 +8859,9 @@ export declare interface VideoMetadata {
|
|
|
8843
8859
|
startOffset?: string;
|
|
8844
8860
|
}
|
|
8845
8861
|
|
|
8846
|
-
/** The configuration for the voice to use. */
|
|
8847
8862
|
export declare interface VoiceConfig {
|
|
8863
|
+
/** If true, the model will use a replicated voice for the response. */
|
|
8864
|
+
replicatedVoiceConfig?: ReplicatedVoiceConfig;
|
|
8848
8865
|
/** The configuration for the prebuilt voice to use. */
|
|
8849
8866
|
prebuiltVoiceConfig?: PrebuiltVoiceConfig;
|
|
8850
8867
|
}
|