@google/genai 1.17.0 → 1.18.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 +114 -3
- package/dist/index.cjs +710 -193
- package/dist/index.mjs +709 -194
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +710 -193
- package/dist/node/index.mjs +709 -194
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +114 -3
- package/dist/web/index.mjs +709 -194
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +114 -3
- package/package.json +1 -1
package/dist/genai.d.ts
CHANGED
|
@@ -437,6 +437,22 @@ export declare class Batches extends BaseModule {
|
|
|
437
437
|
* ```
|
|
438
438
|
*/
|
|
439
439
|
create: (params: types.CreateBatchJobParameters) => Promise<types.BatchJob>;
|
|
440
|
+
/**
|
|
441
|
+
* **Experimental** Creates an embedding batch job.
|
|
442
|
+
*
|
|
443
|
+
* @param params - The parameters for create embedding batch job request.
|
|
444
|
+
* @return The created batch job.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```ts
|
|
448
|
+
* const response = await ai.batches.createEmbeddings({
|
|
449
|
+
* model: 'text-embedding-004',
|
|
450
|
+
* src: {fileName: 'files/my_embedding_input'},
|
|
451
|
+
* });
|
|
452
|
+
* console.log(response);
|
|
453
|
+
* ```
|
|
454
|
+
*/
|
|
455
|
+
createEmbeddings: (params: types.CreateEmbeddingsBatchJobParameters) => Promise<types.BatchJob>;
|
|
440
456
|
/**
|
|
441
457
|
* Lists batch job configurations.
|
|
442
458
|
*
|
|
@@ -452,6 +468,11 @@ export declare class Batches extends BaseModule {
|
|
|
452
468
|
* ```
|
|
453
469
|
*/
|
|
454
470
|
list: (params?: types.ListBatchJobsParameters) => Promise<Pager<types.BatchJob>>;
|
|
471
|
+
private createInlinedGenerateContentRequest;
|
|
472
|
+
private createInlinedEmbedContentRequest;
|
|
473
|
+
private getGcsUri;
|
|
474
|
+
private getBigqueryUri;
|
|
475
|
+
private formatDestination;
|
|
455
476
|
/**
|
|
456
477
|
* Internal method to create batch job.
|
|
457
478
|
*
|
|
@@ -460,6 +481,14 @@ export declare class Batches extends BaseModule {
|
|
|
460
481
|
*
|
|
461
482
|
*/
|
|
462
483
|
private createInternal;
|
|
484
|
+
/**
|
|
485
|
+
* Internal method to create batch job.
|
|
486
|
+
*
|
|
487
|
+
* @param params - The parameters for create batch job request.
|
|
488
|
+
* @return The created batch job.
|
|
489
|
+
*
|
|
490
|
+
*/
|
|
491
|
+
private createEmbeddingsInternal;
|
|
463
492
|
/**
|
|
464
493
|
* Gets batch job configurations.
|
|
465
494
|
*
|
|
@@ -558,6 +587,11 @@ export declare interface BatchJobDestination {
|
|
|
558
587
|
the input requests.
|
|
559
588
|
*/
|
|
560
589
|
inlinedResponses?: InlinedResponse[];
|
|
590
|
+
/** The responses to the requests in the batch. Returned when the batch was
|
|
591
|
+
built using inlined requests. The responses will be in the same order as
|
|
592
|
+
the input requests.
|
|
593
|
+
*/
|
|
594
|
+
inlinedEmbedContentResponses?: InlinedEmbedContentResponse[];
|
|
561
595
|
}
|
|
562
596
|
|
|
563
597
|
export declare type BatchJobDestinationUnion = BatchJobDestination | string;
|
|
@@ -1351,6 +1385,35 @@ export declare interface CreateChatParameters {
|
|
|
1351
1385
|
history?: Content[];
|
|
1352
1386
|
}
|
|
1353
1387
|
|
|
1388
|
+
/** Config for optional parameters. */
|
|
1389
|
+
export declare interface CreateEmbeddingsBatchJobConfig {
|
|
1390
|
+
/** Used to override HTTP request options. */
|
|
1391
|
+
httpOptions?: HttpOptions;
|
|
1392
|
+
/** Abort signal which can be used to cancel the request.
|
|
1393
|
+
|
|
1394
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
1395
|
+
operation will not cancel the request in the service. You will still
|
|
1396
|
+
be charged usage for any applicable operations.
|
|
1397
|
+
*/
|
|
1398
|
+
abortSignal?: AbortSignal;
|
|
1399
|
+
/** The user-defined name of this BatchJob.
|
|
1400
|
+
*/
|
|
1401
|
+
displayName?: string;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/** Config for batches.create parameters. */
|
|
1405
|
+
export declare interface CreateEmbeddingsBatchJobParameters {
|
|
1406
|
+
/** The name of the model to produces the predictions via the BatchJob.
|
|
1407
|
+
*/
|
|
1408
|
+
model?: string;
|
|
1409
|
+
/** input data to run batch job".
|
|
1410
|
+
*/
|
|
1411
|
+
src: EmbeddingsBatchJobSource;
|
|
1412
|
+
/** Optional parameters for creating a BatchJob.
|
|
1413
|
+
*/
|
|
1414
|
+
config?: CreateEmbeddingsBatchJobConfig;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1354
1417
|
/** Used to override the default configuration. */
|
|
1355
1418
|
export declare interface CreateFileConfig {
|
|
1356
1419
|
/** Used to override HTTP request options. */
|
|
@@ -1794,6 +1857,16 @@ export declare enum EditMode {
|
|
|
1794
1857
|
EDIT_MODE_PRODUCT_IMAGE = "EDIT_MODE_PRODUCT_IMAGE"
|
|
1795
1858
|
}
|
|
1796
1859
|
|
|
1860
|
+
/** Parameters for the embed_content method. */
|
|
1861
|
+
export declare interface EmbedContentBatch {
|
|
1862
|
+
/** The content to embed. Only the `parts.text` fields will be counted.
|
|
1863
|
+
*/
|
|
1864
|
+
contents?: ContentListUnion;
|
|
1865
|
+
/** Configuration that contains optional parameters.
|
|
1866
|
+
*/
|
|
1867
|
+
config?: EmbedContentConfig;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1797
1870
|
/** Optional parameters for the embed_content method. */
|
|
1798
1871
|
export declare interface EmbedContentConfig {
|
|
1799
1872
|
/** Used to override HTTP request options. */
|
|
@@ -1862,6 +1935,16 @@ export declare class EmbedContentResponse {
|
|
|
1862
1935
|
metadata?: EmbedContentMetadata;
|
|
1863
1936
|
}
|
|
1864
1937
|
|
|
1938
|
+
export declare interface EmbeddingsBatchJobSource {
|
|
1939
|
+
/** The Gemini Developer API's file resource name of the input data
|
|
1940
|
+
(e.g. "files/12345").
|
|
1941
|
+
*/
|
|
1942
|
+
fileName?: string;
|
|
1943
|
+
/** The Gemini Developer API's inlined input data to run batch job.
|
|
1944
|
+
*/
|
|
1945
|
+
inlinedRequests?: EmbedContentBatch;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1865
1948
|
/** Represents a customer-managed encryption key spec that can be applied to a top-level resource. */
|
|
1866
1949
|
export declare interface EncryptionSpec {
|
|
1867
1950
|
/** Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created. */
|
|
@@ -3662,6 +3745,16 @@ export declare enum ImagePromptLanguage {
|
|
|
3662
3745
|
es = "es"
|
|
3663
3746
|
}
|
|
3664
3747
|
|
|
3748
|
+
/** Config for `inlined_embedding_responses` parameter. */
|
|
3749
|
+
export declare class InlinedEmbedContentResponse {
|
|
3750
|
+
/** The response to the request.
|
|
3751
|
+
*/
|
|
3752
|
+
response?: SingleEmbedContentResponse;
|
|
3753
|
+
/** The error encountered while processing the request.
|
|
3754
|
+
*/
|
|
3755
|
+
error?: JobError;
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3665
3758
|
/** Config for inlined request. */
|
|
3666
3759
|
export declare interface InlinedRequest {
|
|
3667
3760
|
/** ID of the model to use. For a list of models, see `Google models
|
|
@@ -5516,12 +5609,14 @@ export declare interface Part {
|
|
|
5516
5609
|
/** An opaque signature for the thought so it can be reused in subsequent requests.
|
|
5517
5610
|
* @remarks Encoded as base64 string. */
|
|
5518
5611
|
thoughtSignature?: string;
|
|
5612
|
+
/** A predicted [FunctionCall] returned from the model that contains a string
|
|
5613
|
+
representing the [FunctionDeclaration.name] and a structured JSON object
|
|
5614
|
+
containing the parameters and their values. */
|
|
5615
|
+
functionCall?: FunctionCall;
|
|
5519
5616
|
/** Optional. Result of executing the [ExecutableCode]. */
|
|
5520
5617
|
codeExecutionResult?: CodeExecutionResult;
|
|
5521
5618
|
/** Optional. Code generated by the model that is meant to be executed. */
|
|
5522
5619
|
executableCode?: ExecutableCode;
|
|
5523
|
-
/** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
|
|
5524
|
-
functionCall?: FunctionCall;
|
|
5525
5620
|
/** 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. */
|
|
5526
5621
|
functionResponse?: FunctionResponse;
|
|
5527
5622
|
/** Optional. Text part (can be code). */
|
|
@@ -6279,6 +6374,16 @@ export declare interface SessionResumptionConfig {
|
|
|
6279
6374
|
*/
|
|
6280
6375
|
export declare function setDefaultBaseUrls(baseUrlParams: BaseUrlParameters): void;
|
|
6281
6376
|
|
|
6377
|
+
/** Config for `response` parameter. */
|
|
6378
|
+
export declare class SingleEmbedContentResponse {
|
|
6379
|
+
/** The response to the request.
|
|
6380
|
+
*/
|
|
6381
|
+
embedding?: ContentEmbedding;
|
|
6382
|
+
/** The error encountered while processing the request.
|
|
6383
|
+
*/
|
|
6384
|
+
tokenCount?: string;
|
|
6385
|
+
}
|
|
6386
|
+
|
|
6282
6387
|
/** Context window will be truncated by keeping only suffix of it.
|
|
6283
6388
|
|
|
6284
6389
|
Context window will always be cut at start of USER role turn. System
|
|
@@ -7013,9 +7118,9 @@ declare namespace types {
|
|
|
7013
7118
|
VideoMetadata,
|
|
7014
7119
|
Blob_2 as Blob,
|
|
7015
7120
|
FileData,
|
|
7121
|
+
FunctionCall,
|
|
7016
7122
|
CodeExecutionResult,
|
|
7017
7123
|
ExecutableCode,
|
|
7018
|
-
FunctionCall,
|
|
7019
7124
|
FunctionResponse,
|
|
7020
7125
|
Part,
|
|
7021
7126
|
Content,
|
|
@@ -7231,10 +7336,16 @@ declare namespace types {
|
|
|
7231
7336
|
BatchJobSource,
|
|
7232
7337
|
JobError,
|
|
7233
7338
|
InlinedResponse,
|
|
7339
|
+
SingleEmbedContentResponse,
|
|
7340
|
+
InlinedEmbedContentResponse,
|
|
7234
7341
|
BatchJobDestination,
|
|
7235
7342
|
CreateBatchJobConfig,
|
|
7236
7343
|
CreateBatchJobParameters,
|
|
7237
7344
|
BatchJob,
|
|
7345
|
+
EmbedContentBatch,
|
|
7346
|
+
EmbeddingsBatchJobSource,
|
|
7347
|
+
CreateEmbeddingsBatchJobConfig,
|
|
7348
|
+
CreateEmbeddingsBatchJobParameters,
|
|
7238
7349
|
GetBatchJobConfig,
|
|
7239
7350
|
GetBatchJobParameters,
|
|
7240
7351
|
CancelBatchJobConfig,
|