@google/genai 1.16.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 +189 -140
- package/dist/index.cjs +718 -230
- package/dist/index.mjs +717 -231
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +718 -230
- package/dist/node/index.mjs +717 -231
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +189 -140
- package/dist/web/index.mjs +717 -231
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +189 -140
- package/package.json +1 -1
package/dist/node/node.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. */
|
|
@@ -1720,54 +1783,40 @@ export declare interface EditImageConfig {
|
|
|
1720
1783
|
be charged usage for any applicable operations.
|
|
1721
1784
|
*/
|
|
1722
1785
|
abortSignal?: AbortSignal;
|
|
1723
|
-
/** Cloud Storage URI used to store the generated images.
|
|
1724
|
-
*/
|
|
1786
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
1725
1787
|
outputGcsUri?: string;
|
|
1726
|
-
/** Description of what to discourage in the generated images.
|
|
1727
|
-
*/
|
|
1788
|
+
/** Description of what to discourage in the generated images. */
|
|
1728
1789
|
negativePrompt?: string;
|
|
1729
|
-
/** Number of images to generate.
|
|
1730
|
-
*/
|
|
1790
|
+
/** Number of images to generate. */
|
|
1731
1791
|
numberOfImages?: number;
|
|
1732
1792
|
/** Aspect ratio of the generated images. Supported values are
|
|
1733
|
-
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
|
1734
|
-
*/
|
|
1793
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9". */
|
|
1735
1794
|
aspectRatio?: string;
|
|
1736
1795
|
/** Controls how much the model adheres to the text prompt. Large
|
|
1737
1796
|
values increase output and prompt alignment, but may compromise image
|
|
1738
|
-
quality.
|
|
1739
|
-
*/
|
|
1797
|
+
quality. */
|
|
1740
1798
|
guidanceScale?: number;
|
|
1741
1799
|
/** Random seed for image generation. This is not available when
|
|
1742
|
-
``add_watermark`` is set to true.
|
|
1743
|
-
*/
|
|
1800
|
+
``add_watermark`` is set to true. */
|
|
1744
1801
|
seed?: number;
|
|
1745
|
-
/** Filter level for safety filtering.
|
|
1746
|
-
*/
|
|
1802
|
+
/** Filter level for safety filtering. */
|
|
1747
1803
|
safetyFilterLevel?: SafetyFilterLevel;
|
|
1748
|
-
/** Allows generation of people by the model.
|
|
1749
|
-
*/
|
|
1804
|
+
/** Allows generation of people by the model. */
|
|
1750
1805
|
personGeneration?: PersonGeneration;
|
|
1751
1806
|
/** Whether to report the safety scores of each generated image and
|
|
1752
|
-
the positive prompt in the response.
|
|
1753
|
-
*/
|
|
1807
|
+
the positive prompt in the response. */
|
|
1754
1808
|
includeSafetyAttributes?: boolean;
|
|
1755
1809
|
/** Whether to include the Responsible AI filter reason if the image
|
|
1756
|
-
is filtered out of the response.
|
|
1757
|
-
*/
|
|
1810
|
+
is filtered out of the response. */
|
|
1758
1811
|
includeRaiReason?: boolean;
|
|
1759
|
-
/** Language of the text in the prompt.
|
|
1760
|
-
*/
|
|
1812
|
+
/** Language of the text in the prompt. */
|
|
1761
1813
|
language?: ImagePromptLanguage;
|
|
1762
|
-
/** MIME type of the generated image.
|
|
1763
|
-
*/
|
|
1814
|
+
/** MIME type of the generated image. */
|
|
1764
1815
|
outputMimeType?: string;
|
|
1765
1816
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
1766
|
-
only).
|
|
1767
|
-
*/
|
|
1817
|
+
only). */
|
|
1768
1818
|
outputCompressionQuality?: number;
|
|
1769
|
-
/** Whether to add a watermark to the generated images.
|
|
1770
|
-
*/
|
|
1819
|
+
/** Whether to add a watermark to the generated images. */
|
|
1771
1820
|
addWatermark?: boolean;
|
|
1772
1821
|
/** Describes the editing mode for the request. */
|
|
1773
1822
|
editMode?: EditMode;
|
|
@@ -1796,7 +1845,7 @@ export declare class EditImageResponse {
|
|
|
1796
1845
|
generatedImages?: GeneratedImage[];
|
|
1797
1846
|
}
|
|
1798
1847
|
|
|
1799
|
-
/** Enum representing the
|
|
1848
|
+
/** Enum representing the editing mode. */
|
|
1800
1849
|
export declare enum EditMode {
|
|
1801
1850
|
EDIT_MODE_DEFAULT = "EDIT_MODE_DEFAULT",
|
|
1802
1851
|
EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
|
|
@@ -1808,6 +1857,16 @@ export declare enum EditMode {
|
|
|
1808
1857
|
EDIT_MODE_PRODUCT_IMAGE = "EDIT_MODE_PRODUCT_IMAGE"
|
|
1809
1858
|
}
|
|
1810
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
|
+
|
|
1811
1870
|
/** Optional parameters for the embed_content method. */
|
|
1812
1871
|
export declare interface EmbedContentConfig {
|
|
1813
1872
|
/** Used to override HTTP request options. */
|
|
@@ -1876,6 +1935,16 @@ export declare class EmbedContentResponse {
|
|
|
1876
1935
|
metadata?: EmbedContentMetadata;
|
|
1877
1936
|
}
|
|
1878
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
|
+
|
|
1879
1948
|
/** Represents a customer-managed encryption key spec that can be applied to a top-level resource. */
|
|
1880
1949
|
export declare interface EncryptionSpec {
|
|
1881
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. */
|
|
@@ -2724,20 +2793,16 @@ export declare class GenerateContentResponseUsageMetadata {
|
|
|
2724
2793
|
|
|
2725
2794
|
/** An output image. */
|
|
2726
2795
|
export declare interface GeneratedImage {
|
|
2727
|
-
/** The output image data.
|
|
2728
|
-
*/
|
|
2796
|
+
/** The output image data. */
|
|
2729
2797
|
image?: Image_2;
|
|
2730
2798
|
/** Responsible AI filter reason if the image is filtered out of the
|
|
2731
|
-
response.
|
|
2732
|
-
*/
|
|
2799
|
+
response. */
|
|
2733
2800
|
raiFilteredReason?: string;
|
|
2734
2801
|
/** Safety attributes of the image. Lists of RAI categories and their
|
|
2735
|
-
scores of each content.
|
|
2736
|
-
*/
|
|
2802
|
+
scores of each content. */
|
|
2737
2803
|
safetyAttributes?: SafetyAttributes;
|
|
2738
2804
|
/** The rewritten prompt used for the image generation if the prompt
|
|
2739
|
-
enhancer is enabled.
|
|
2740
|
-
*/
|
|
2805
|
+
enhancer is enabled. */
|
|
2741
2806
|
enhancedPrompt?: string;
|
|
2742
2807
|
}
|
|
2743
2808
|
|
|
@@ -2766,61 +2831,45 @@ export declare interface GenerateImagesConfig {
|
|
|
2766
2831
|
be charged usage for any applicable operations.
|
|
2767
2832
|
*/
|
|
2768
2833
|
abortSignal?: AbortSignal;
|
|
2769
|
-
/** Cloud Storage URI used to store the generated images.
|
|
2770
|
-
*/
|
|
2834
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
2771
2835
|
outputGcsUri?: string;
|
|
2772
|
-
/** Description of what to discourage in the generated images.
|
|
2773
|
-
*/
|
|
2836
|
+
/** Description of what to discourage in the generated images. */
|
|
2774
2837
|
negativePrompt?: string;
|
|
2775
|
-
/** Number of images to generate.
|
|
2776
|
-
*/
|
|
2838
|
+
/** Number of images to generate. */
|
|
2777
2839
|
numberOfImages?: number;
|
|
2778
2840
|
/** Aspect ratio of the generated images. Supported values are
|
|
2779
|
-
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
|
2780
|
-
*/
|
|
2841
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9". */
|
|
2781
2842
|
aspectRatio?: string;
|
|
2782
2843
|
/** Controls how much the model adheres to the text prompt. Large
|
|
2783
2844
|
values increase output and prompt alignment, but may compromise image
|
|
2784
|
-
quality.
|
|
2785
|
-
*/
|
|
2845
|
+
quality. */
|
|
2786
2846
|
guidanceScale?: number;
|
|
2787
2847
|
/** Random seed for image generation. This is not available when
|
|
2788
|
-
``add_watermark`` is set to true.
|
|
2789
|
-
*/
|
|
2848
|
+
``add_watermark`` is set to true. */
|
|
2790
2849
|
seed?: number;
|
|
2791
|
-
/** Filter level for safety filtering.
|
|
2792
|
-
*/
|
|
2850
|
+
/** Filter level for safety filtering. */
|
|
2793
2851
|
safetyFilterLevel?: SafetyFilterLevel;
|
|
2794
|
-
/** Allows generation of people by the model.
|
|
2795
|
-
*/
|
|
2852
|
+
/** Allows generation of people by the model. */
|
|
2796
2853
|
personGeneration?: PersonGeneration;
|
|
2797
2854
|
/** Whether to report the safety scores of each generated image and
|
|
2798
|
-
the positive prompt in the response.
|
|
2799
|
-
*/
|
|
2855
|
+
the positive prompt in the response. */
|
|
2800
2856
|
includeSafetyAttributes?: boolean;
|
|
2801
2857
|
/** Whether to include the Responsible AI filter reason if the image
|
|
2802
|
-
is filtered out of the response.
|
|
2803
|
-
*/
|
|
2858
|
+
is filtered out of the response. */
|
|
2804
2859
|
includeRaiReason?: boolean;
|
|
2805
|
-
/** Language of the text in the prompt.
|
|
2806
|
-
*/
|
|
2860
|
+
/** Language of the text in the prompt. */
|
|
2807
2861
|
language?: ImagePromptLanguage;
|
|
2808
|
-
/** MIME type of the generated image.
|
|
2809
|
-
*/
|
|
2862
|
+
/** MIME type of the generated image. */
|
|
2810
2863
|
outputMimeType?: string;
|
|
2811
2864
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
2812
|
-
only).
|
|
2813
|
-
*/
|
|
2865
|
+
only). */
|
|
2814
2866
|
outputCompressionQuality?: number;
|
|
2815
|
-
/** Whether to add a watermark to the generated images.
|
|
2816
|
-
*/
|
|
2867
|
+
/** Whether to add a watermark to the generated images. */
|
|
2817
2868
|
addWatermark?: boolean;
|
|
2818
2869
|
/** The size of the largest dimension of the generated image.
|
|
2819
|
-
Supported sizes are 1K and 2K (not supported for Imagen 3 models).
|
|
2820
|
-
*/
|
|
2870
|
+
Supported sizes are 1K and 2K (not supported for Imagen 3 models). */
|
|
2821
2871
|
imageSize?: string;
|
|
2822
|
-
/** Whether to use the prompt rewriting logic.
|
|
2823
|
-
*/
|
|
2872
|
+
/** Whether to use the prompt rewriting logic. */
|
|
2824
2873
|
enhancePrompt?: boolean;
|
|
2825
2874
|
}
|
|
2826
2875
|
|
|
@@ -2841,12 +2890,10 @@ export declare interface GenerateImagesParameters {
|
|
|
2841
2890
|
export declare class GenerateImagesResponse {
|
|
2842
2891
|
/** Used to retain the full HTTP response. */
|
|
2843
2892
|
sdkHttpResponse?: HttpResponse;
|
|
2844
|
-
/** List of generated images.
|
|
2845
|
-
*/
|
|
2893
|
+
/** List of generated images. */
|
|
2846
2894
|
generatedImages?: GeneratedImage[];
|
|
2847
2895
|
/** Safety attributes of the positive prompt. Only populated if
|
|
2848
|
-
``include_safety_attributes`` is set to True.
|
|
2849
|
-
*/
|
|
2896
|
+
``include_safety_attributes`` is set to True. */
|
|
2850
2897
|
positivePromptSafetyAttributes?: SafetyAttributes;
|
|
2851
2898
|
}
|
|
2852
2899
|
|
|
@@ -2869,23 +2916,32 @@ export declare interface GenerateVideosConfig {
|
|
|
2869
2916
|
fps?: number;
|
|
2870
2917
|
/** Duration of the clip for video generation in seconds. */
|
|
2871
2918
|
durationSeconds?: number;
|
|
2872
|
-
/** The RNG seed. If RNG seed is exactly same for each request with
|
|
2919
|
+
/** The RNG seed. If RNG seed is exactly same for each request with
|
|
2920
|
+
unchanged inputs, the prediction results will be consistent. Otherwise,
|
|
2921
|
+
a random RNG seed will be used each time to produce a different
|
|
2922
|
+
result. */
|
|
2873
2923
|
seed?: number;
|
|
2874
|
-
/** The aspect ratio for the generated video. 16:9 (landscape) and
|
|
2924
|
+
/** The aspect ratio for the generated video. 16:9 (landscape) and
|
|
2925
|
+
9:16 (portrait) are supported. */
|
|
2875
2926
|
aspectRatio?: string;
|
|
2876
|
-
/** The resolution for the generated video. 720p and 1080p are
|
|
2927
|
+
/** The resolution for the generated video. 720p and 1080p are
|
|
2928
|
+
supported. */
|
|
2877
2929
|
resolution?: string;
|
|
2878
|
-
/** Whether allow to generate person videos, and restrict to specific
|
|
2930
|
+
/** Whether allow to generate person videos, and restrict to specific
|
|
2931
|
+
ages. Supported values are: dont_allow, allow_adult. */
|
|
2879
2932
|
personGeneration?: string;
|
|
2880
|
-
/** The pubsub topic where to publish the video generation
|
|
2933
|
+
/** The pubsub topic where to publish the video generation
|
|
2934
|
+
progress. */
|
|
2881
2935
|
pubsubTopic?: string;
|
|
2882
|
-
/**
|
|
2936
|
+
/** Explicitly state what should not be included in the generated
|
|
2937
|
+
videos. */
|
|
2883
2938
|
negativePrompt?: string;
|
|
2884
2939
|
/** Whether to use the prompt rewriting logic. */
|
|
2885
2940
|
enhancePrompt?: boolean;
|
|
2886
2941
|
/** Whether to generate audio along with the video. */
|
|
2887
2942
|
generateAudio?: boolean;
|
|
2888
|
-
/** Image to use as the last frame of generated videos.
|
|
2943
|
+
/** Image to use as the last frame of generated videos.
|
|
2944
|
+
Only supported for image to video use cases. */
|
|
2889
2945
|
lastFrame?: Image_2;
|
|
2890
2946
|
/** The images to use as the references to generate the videos.
|
|
2891
2947
|
If this field is provided, the text prompt field must also be provided.
|
|
@@ -2923,13 +2979,14 @@ export declare interface GenerateVideosParameters {
|
|
|
2923
2979
|
/** ID of the model to use. For a list of models, see `Google models
|
|
2924
2980
|
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_. */
|
|
2925
2981
|
model: string;
|
|
2926
|
-
/** The text prompt for generating the videos.
|
|
2982
|
+
/** The text prompt for generating the videos.
|
|
2983
|
+
Optional if image or video is provided. */
|
|
2927
2984
|
prompt?: string;
|
|
2928
2985
|
/** The input image for generating the videos.
|
|
2929
|
-
Optional if prompt
|
|
2986
|
+
Optional if prompt is provided. Not allowed if video is provided. */
|
|
2930
2987
|
image?: Image_2;
|
|
2931
2988
|
/** The input video for video extension use cases.
|
|
2932
|
-
Optional if prompt
|
|
2989
|
+
Optional if prompt is provided. Not allowed if image is provided. */
|
|
2933
2990
|
video?: Video;
|
|
2934
2991
|
/** A set of source input(s) for video generation. */
|
|
2935
2992
|
source?: GenerateVideosSource;
|
|
@@ -2953,10 +3010,10 @@ export declare interface GenerateVideosSource {
|
|
|
2953
3010
|
Optional if image or video is provided. */
|
|
2954
3011
|
prompt?: string;
|
|
2955
3012
|
/** The input image for generating the videos.
|
|
2956
|
-
Optional if prompt
|
|
3013
|
+
Optional if prompt is provided. Not allowed if video is provided. */
|
|
2957
3014
|
image?: Image_2;
|
|
2958
3015
|
/** The input video for video extension use cases.
|
|
2959
|
-
Optional if prompt
|
|
3016
|
+
Optional if prompt is provided. Not allowed if image is provided. */
|
|
2960
3017
|
video?: Video;
|
|
2961
3018
|
}
|
|
2962
3019
|
|
|
@@ -3653,12 +3710,10 @@ export declare class HttpResponse {
|
|
|
3653
3710
|
/** An image. */
|
|
3654
3711
|
declare interface Image_2 {
|
|
3655
3712
|
/** The Cloud Storage URI of the image. ``Image`` can contain a value
|
|
3656
|
-
for this field or the ``image_bytes`` field but not both.
|
|
3657
|
-
*/
|
|
3713
|
+
for this field or the ``image_bytes`` field but not both. */
|
|
3658
3714
|
gcsUri?: string;
|
|
3659
3715
|
/** The image bytes data. ``Image`` can contain a value for this field
|
|
3660
3716
|
or the ``gcs_uri`` field but not both.
|
|
3661
|
-
|
|
3662
3717
|
* @remarks Encoded as base64 string. */
|
|
3663
3718
|
imageBytes?: string;
|
|
3664
3719
|
/** The MIME type of the image. */
|
|
@@ -3702,6 +3757,16 @@ export declare enum ImagePromptLanguage {
|
|
|
3702
3757
|
es = "es"
|
|
3703
3758
|
}
|
|
3704
3759
|
|
|
3760
|
+
/** Config for `inlined_embedding_responses` parameter. */
|
|
3761
|
+
export declare class InlinedEmbedContentResponse {
|
|
3762
|
+
/** The response to the request.
|
|
3763
|
+
*/
|
|
3764
|
+
response?: SingleEmbedContentResponse;
|
|
3765
|
+
/** The error encountered while processing the request.
|
|
3766
|
+
*/
|
|
3767
|
+
error?: JobError;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3705
3770
|
/** Config for inlined request. */
|
|
3706
3771
|
export declare interface InlinedRequest {
|
|
3707
3772
|
/** ID of the model to use. For a list of models, see `Google models
|
|
@@ -5149,26 +5214,16 @@ export declare class Models extends BaseModule {
|
|
|
5149
5214
|
*/
|
|
5150
5215
|
embedContent(params: types.EmbedContentParameters): Promise<types.EmbedContentResponse>;
|
|
5151
5216
|
/**
|
|
5152
|
-
*
|
|
5153
|
-
*
|
|
5154
|
-
* @param params - The parameters for generating images.
|
|
5155
|
-
* @return The response from the API.
|
|
5156
|
-
*
|
|
5157
|
-
* @example
|
|
5158
|
-
* ```ts
|
|
5159
|
-
* const response = await ai.models.generateImages({
|
|
5160
|
-
* model: 'imagen-3.0-generate-002',
|
|
5161
|
-
* prompt: 'Robot holding a red skateboard',
|
|
5162
|
-
* config: {
|
|
5163
|
-
* numberOfImages: 1,
|
|
5164
|
-
* includeRaiReason: true,
|
|
5165
|
-
* },
|
|
5166
|
-
* });
|
|
5167
|
-
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
5168
|
-
* ```
|
|
5217
|
+
* Private method for generating images.
|
|
5169
5218
|
*/
|
|
5170
5219
|
private generateImagesInternal;
|
|
5220
|
+
/**
|
|
5221
|
+
* Private method for editing an image.
|
|
5222
|
+
*/
|
|
5171
5223
|
private editImageInternal;
|
|
5224
|
+
/**
|
|
5225
|
+
* Private method for upscaling an image.
|
|
5226
|
+
*/
|
|
5172
5227
|
private upscaleImageInternal;
|
|
5173
5228
|
/**
|
|
5174
5229
|
* Recontextualizes an image.
|
|
@@ -5307,27 +5362,7 @@ export declare class Models extends BaseModule {
|
|
|
5307
5362
|
*/
|
|
5308
5363
|
computeTokens(params: types.ComputeTokensParameters): Promise<types.ComputeTokensResponse>;
|
|
5309
5364
|
/**
|
|
5310
|
-
*
|
|
5311
|
-
*
|
|
5312
|
-
* @param params - The parameters for generating videos.
|
|
5313
|
-
* @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
|
|
5314
|
-
*
|
|
5315
|
-
* @example
|
|
5316
|
-
* ```ts
|
|
5317
|
-
* const operation = await ai.models.generateVideos({
|
|
5318
|
-
* model: 'veo-2.0-generate-001',
|
|
5319
|
-
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5320
|
-
* config: {
|
|
5321
|
-
* numberOfVideos: 1
|
|
5322
|
-
* });
|
|
5323
|
-
*
|
|
5324
|
-
* while (!operation.done) {
|
|
5325
|
-
* await new Promise(resolve => setTimeout(resolve, 10000));
|
|
5326
|
-
* operation = await ai.operations.getVideosOperation({operation: operation});
|
|
5327
|
-
* }
|
|
5328
|
-
*
|
|
5329
|
-
* console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
|
|
5330
|
-
* ```
|
|
5365
|
+
* Private method for generating videos.
|
|
5331
5366
|
*/
|
|
5332
5367
|
private generateVideosInternal;
|
|
5333
5368
|
}
|
|
@@ -5586,12 +5621,14 @@ export declare interface Part {
|
|
|
5586
5621
|
/** An opaque signature for the thought so it can be reused in subsequent requests.
|
|
5587
5622
|
* @remarks Encoded as base64 string. */
|
|
5588
5623
|
thoughtSignature?: string;
|
|
5624
|
+
/** A predicted [FunctionCall] returned from the model that contains a string
|
|
5625
|
+
representing the [FunctionDeclaration.name] and a structured JSON object
|
|
5626
|
+
containing the parameters and their values. */
|
|
5627
|
+
functionCall?: FunctionCall;
|
|
5589
5628
|
/** Optional. Result of executing the [ExecutableCode]. */
|
|
5590
5629
|
codeExecutionResult?: CodeExecutionResult;
|
|
5591
5630
|
/** Optional. Code generated by the model that is meant to be executed. */
|
|
5592
5631
|
executableCode?: ExecutableCode;
|
|
5593
|
-
/** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
|
|
5594
|
-
functionCall?: FunctionCall;
|
|
5595
5632
|
/** 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. */
|
|
5596
5633
|
functionResponse?: FunctionResponse;
|
|
5597
5634
|
/** Optional. Text part (can be code). */
|
|
@@ -5915,14 +5952,11 @@ export declare interface RetrievalMetadata {
|
|
|
5915
5952
|
|
|
5916
5953
|
/** Safety attributes of a GeneratedImage or the user-provided prompt. */
|
|
5917
5954
|
export declare interface SafetyAttributes {
|
|
5918
|
-
/** List of RAI categories.
|
|
5919
|
-
*/
|
|
5955
|
+
/** List of RAI categories. */
|
|
5920
5956
|
categories?: string[];
|
|
5921
|
-
/** List of scores of each categories.
|
|
5922
|
-
*/
|
|
5957
|
+
/** List of scores of each categories. */
|
|
5923
5958
|
scores?: number[];
|
|
5924
|
-
/** Internal use only.
|
|
5925
|
-
*/
|
|
5959
|
+
/** Internal use only. */
|
|
5926
5960
|
contentType?: string;
|
|
5927
5961
|
}
|
|
5928
5962
|
|
|
@@ -6352,6 +6386,16 @@ export declare interface SessionResumptionConfig {
|
|
|
6352
6386
|
*/
|
|
6353
6387
|
export declare function setDefaultBaseUrls(baseUrlParams: BaseUrlParameters): void;
|
|
6354
6388
|
|
|
6389
|
+
/** Config for `response` parameter. */
|
|
6390
|
+
export declare class SingleEmbedContentResponse {
|
|
6391
|
+
/** The response to the request.
|
|
6392
|
+
*/
|
|
6393
|
+
embedding?: ContentEmbedding;
|
|
6394
|
+
/** The error encountered while processing the request.
|
|
6395
|
+
*/
|
|
6396
|
+
tokenCount?: string;
|
|
6397
|
+
}
|
|
6398
|
+
|
|
6355
6399
|
/** Context window will be truncated by keeping only suffix of it.
|
|
6356
6400
|
|
|
6357
6401
|
Context window will always be cut at start of USER role turn. System
|
|
@@ -7086,9 +7130,9 @@ declare namespace types {
|
|
|
7086
7130
|
VideoMetadata,
|
|
7087
7131
|
Blob_2 as Blob,
|
|
7088
7132
|
FileData,
|
|
7133
|
+
FunctionCall,
|
|
7089
7134
|
CodeExecutionResult,
|
|
7090
7135
|
ExecutableCode,
|
|
7091
|
-
FunctionCall,
|
|
7092
7136
|
FunctionResponse,
|
|
7093
7137
|
Part,
|
|
7094
7138
|
Content,
|
|
@@ -7304,10 +7348,16 @@ declare namespace types {
|
|
|
7304
7348
|
BatchJobSource,
|
|
7305
7349
|
JobError,
|
|
7306
7350
|
InlinedResponse,
|
|
7351
|
+
SingleEmbedContentResponse,
|
|
7352
|
+
InlinedEmbedContentResponse,
|
|
7307
7353
|
BatchJobDestination,
|
|
7308
7354
|
CreateBatchJobConfig,
|
|
7309
7355
|
CreateBatchJobParameters,
|
|
7310
7356
|
BatchJob,
|
|
7357
|
+
EmbedContentBatch,
|
|
7358
|
+
EmbeddingsBatchJobSource,
|
|
7359
|
+
CreateEmbeddingsBatchJobConfig,
|
|
7360
|
+
CreateEmbeddingsBatchJobParameters,
|
|
7311
7361
|
GetBatchJobConfig,
|
|
7312
7362
|
GetBatchJobParameters,
|
|
7313
7363
|
CancelBatchJobConfig,
|
|
@@ -7529,8 +7579,8 @@ export declare interface UpscaleImageConfig {
|
|
|
7529
7579
|
includeRaiReason?: boolean;
|
|
7530
7580
|
/** The image format that the output should be saved as. */
|
|
7531
7581
|
outputMimeType?: string;
|
|
7532
|
-
/** The level of compression if the
|
|
7533
|
-
``image/jpeg``. */
|
|
7582
|
+
/** The level of compression. Only applicable if the
|
|
7583
|
+
``output_mime_type`` is ``image/jpeg``. */
|
|
7534
7584
|
outputCompressionQuality?: number;
|
|
7535
7585
|
/** Whether to add an image enhancing step before upscaling.
|
|
7536
7586
|
It is expected to suppress the noise and JPEG compression artifacts
|
|
@@ -7684,7 +7734,7 @@ export declare interface Video {
|
|
|
7684
7734
|
/** Video bytes.
|
|
7685
7735
|
* @remarks Encoded as base64 string. */
|
|
7686
7736
|
videoBytes?: string;
|
|
7687
|
-
/** Video encoding, for example
|
|
7737
|
+
/** Video encoding, for example ``video/mp4``. */
|
|
7688
7738
|
mimeType?: string;
|
|
7689
7739
|
}
|
|
7690
7740
|
|
|
@@ -7704,8 +7754,7 @@ export declare enum VideoCompressionQuality {
|
|
|
7704
7754
|
|
|
7705
7755
|
/** A reference image for video generation. */
|
|
7706
7756
|
export declare interface VideoGenerationReferenceImage {
|
|
7707
|
-
/** The reference image.
|
|
7708
|
-
*/
|
|
7757
|
+
/** The reference image. */
|
|
7709
7758
|
image?: Image_2;
|
|
7710
7759
|
/** The type of the reference image, which defines how the reference
|
|
7711
7760
|
image will be used to generate the video. */
|