@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/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. */
|
|
@@ -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
|
|
|
@@ -3641,12 +3698,10 @@ export declare class HttpResponse {
|
|
|
3641
3698
|
/** An image. */
|
|
3642
3699
|
declare interface Image_2 {
|
|
3643
3700
|
/** The Cloud Storage URI of the image. ``Image`` can contain a value
|
|
3644
|
-
for this field or the ``image_bytes`` field but not both.
|
|
3645
|
-
*/
|
|
3701
|
+
for this field or the ``image_bytes`` field but not both. */
|
|
3646
3702
|
gcsUri?: string;
|
|
3647
3703
|
/** The image bytes data. ``Image`` can contain a value for this field
|
|
3648
3704
|
or the ``gcs_uri`` field but not both.
|
|
3649
|
-
|
|
3650
3705
|
* @remarks Encoded as base64 string. */
|
|
3651
3706
|
imageBytes?: string;
|
|
3652
3707
|
/** The MIME type of the image. */
|
|
@@ -3690,6 +3745,16 @@ export declare enum ImagePromptLanguage {
|
|
|
3690
3745
|
es = "es"
|
|
3691
3746
|
}
|
|
3692
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
|
+
|
|
3693
3758
|
/** Config for inlined request. */
|
|
3694
3759
|
export declare interface InlinedRequest {
|
|
3695
3760
|
/** ID of the model to use. For a list of models, see `Google models
|
|
@@ -5137,26 +5202,16 @@ export declare class Models extends BaseModule {
|
|
|
5137
5202
|
*/
|
|
5138
5203
|
embedContent(params: types.EmbedContentParameters): Promise<types.EmbedContentResponse>;
|
|
5139
5204
|
/**
|
|
5140
|
-
*
|
|
5141
|
-
*
|
|
5142
|
-
* @param params - The parameters for generating images.
|
|
5143
|
-
* @return The response from the API.
|
|
5144
|
-
*
|
|
5145
|
-
* @example
|
|
5146
|
-
* ```ts
|
|
5147
|
-
* const response = await ai.models.generateImages({
|
|
5148
|
-
* model: 'imagen-3.0-generate-002',
|
|
5149
|
-
* prompt: 'Robot holding a red skateboard',
|
|
5150
|
-
* config: {
|
|
5151
|
-
* numberOfImages: 1,
|
|
5152
|
-
* includeRaiReason: true,
|
|
5153
|
-
* },
|
|
5154
|
-
* });
|
|
5155
|
-
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
5156
|
-
* ```
|
|
5205
|
+
* Private method for generating images.
|
|
5157
5206
|
*/
|
|
5158
5207
|
private generateImagesInternal;
|
|
5208
|
+
/**
|
|
5209
|
+
* Private method for editing an image.
|
|
5210
|
+
*/
|
|
5159
5211
|
private editImageInternal;
|
|
5212
|
+
/**
|
|
5213
|
+
* Private method for upscaling an image.
|
|
5214
|
+
*/
|
|
5160
5215
|
private upscaleImageInternal;
|
|
5161
5216
|
/**
|
|
5162
5217
|
* Recontextualizes an image.
|
|
@@ -5295,27 +5350,7 @@ export declare class Models extends BaseModule {
|
|
|
5295
5350
|
*/
|
|
5296
5351
|
computeTokens(params: types.ComputeTokensParameters): Promise<types.ComputeTokensResponse>;
|
|
5297
5352
|
/**
|
|
5298
|
-
*
|
|
5299
|
-
*
|
|
5300
|
-
* @param params - The parameters for generating videos.
|
|
5301
|
-
* @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
|
|
5302
|
-
*
|
|
5303
|
-
* @example
|
|
5304
|
-
* ```ts
|
|
5305
|
-
* const operation = await ai.models.generateVideos({
|
|
5306
|
-
* model: 'veo-2.0-generate-001',
|
|
5307
|
-
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5308
|
-
* config: {
|
|
5309
|
-
* numberOfVideos: 1
|
|
5310
|
-
* });
|
|
5311
|
-
*
|
|
5312
|
-
* while (!operation.done) {
|
|
5313
|
-
* await new Promise(resolve => setTimeout(resolve, 10000));
|
|
5314
|
-
* operation = await ai.operations.getVideosOperation({operation: operation});
|
|
5315
|
-
* }
|
|
5316
|
-
*
|
|
5317
|
-
* console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
|
|
5318
|
-
* ```
|
|
5353
|
+
* Private method for generating videos.
|
|
5319
5354
|
*/
|
|
5320
5355
|
private generateVideosInternal;
|
|
5321
5356
|
}
|
|
@@ -5574,12 +5609,14 @@ export declare interface Part {
|
|
|
5574
5609
|
/** An opaque signature for the thought so it can be reused in subsequent requests.
|
|
5575
5610
|
* @remarks Encoded as base64 string. */
|
|
5576
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;
|
|
5577
5616
|
/** Optional. Result of executing the [ExecutableCode]. */
|
|
5578
5617
|
codeExecutionResult?: CodeExecutionResult;
|
|
5579
5618
|
/** Optional. Code generated by the model that is meant to be executed. */
|
|
5580
5619
|
executableCode?: ExecutableCode;
|
|
5581
|
-
/** Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values. */
|
|
5582
|
-
functionCall?: FunctionCall;
|
|
5583
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. */
|
|
5584
5621
|
functionResponse?: FunctionResponse;
|
|
5585
5622
|
/** Optional. Text part (can be code). */
|
|
@@ -5903,14 +5940,11 @@ export declare interface RetrievalMetadata {
|
|
|
5903
5940
|
|
|
5904
5941
|
/** Safety attributes of a GeneratedImage or the user-provided prompt. */
|
|
5905
5942
|
export declare interface SafetyAttributes {
|
|
5906
|
-
/** List of RAI categories.
|
|
5907
|
-
*/
|
|
5943
|
+
/** List of RAI categories. */
|
|
5908
5944
|
categories?: string[];
|
|
5909
|
-
/** List of scores of each categories.
|
|
5910
|
-
*/
|
|
5945
|
+
/** List of scores of each categories. */
|
|
5911
5946
|
scores?: number[];
|
|
5912
|
-
/** Internal use only.
|
|
5913
|
-
*/
|
|
5947
|
+
/** Internal use only. */
|
|
5914
5948
|
contentType?: string;
|
|
5915
5949
|
}
|
|
5916
5950
|
|
|
@@ -6340,6 +6374,16 @@ export declare interface SessionResumptionConfig {
|
|
|
6340
6374
|
*/
|
|
6341
6375
|
export declare function setDefaultBaseUrls(baseUrlParams: BaseUrlParameters): void;
|
|
6342
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
|
+
|
|
6343
6387
|
/** Context window will be truncated by keeping only suffix of it.
|
|
6344
6388
|
|
|
6345
6389
|
Context window will always be cut at start of USER role turn. System
|
|
@@ -7074,9 +7118,9 @@ declare namespace types {
|
|
|
7074
7118
|
VideoMetadata,
|
|
7075
7119
|
Blob_2 as Blob,
|
|
7076
7120
|
FileData,
|
|
7121
|
+
FunctionCall,
|
|
7077
7122
|
CodeExecutionResult,
|
|
7078
7123
|
ExecutableCode,
|
|
7079
|
-
FunctionCall,
|
|
7080
7124
|
FunctionResponse,
|
|
7081
7125
|
Part,
|
|
7082
7126
|
Content,
|
|
@@ -7292,10 +7336,16 @@ declare namespace types {
|
|
|
7292
7336
|
BatchJobSource,
|
|
7293
7337
|
JobError,
|
|
7294
7338
|
InlinedResponse,
|
|
7339
|
+
SingleEmbedContentResponse,
|
|
7340
|
+
InlinedEmbedContentResponse,
|
|
7295
7341
|
BatchJobDestination,
|
|
7296
7342
|
CreateBatchJobConfig,
|
|
7297
7343
|
CreateBatchJobParameters,
|
|
7298
7344
|
BatchJob,
|
|
7345
|
+
EmbedContentBatch,
|
|
7346
|
+
EmbeddingsBatchJobSource,
|
|
7347
|
+
CreateEmbeddingsBatchJobConfig,
|
|
7348
|
+
CreateEmbeddingsBatchJobParameters,
|
|
7299
7349
|
GetBatchJobConfig,
|
|
7300
7350
|
GetBatchJobParameters,
|
|
7301
7351
|
CancelBatchJobConfig,
|
|
@@ -7517,8 +7567,8 @@ export declare interface UpscaleImageConfig {
|
|
|
7517
7567
|
includeRaiReason?: boolean;
|
|
7518
7568
|
/** The image format that the output should be saved as. */
|
|
7519
7569
|
outputMimeType?: string;
|
|
7520
|
-
/** The level of compression if the
|
|
7521
|
-
``image/jpeg``. */
|
|
7570
|
+
/** The level of compression. Only applicable if the
|
|
7571
|
+
``output_mime_type`` is ``image/jpeg``. */
|
|
7522
7572
|
outputCompressionQuality?: number;
|
|
7523
7573
|
/** Whether to add an image enhancing step before upscaling.
|
|
7524
7574
|
It is expected to suppress the noise and JPEG compression artifacts
|
|
@@ -7672,7 +7722,7 @@ export declare interface Video {
|
|
|
7672
7722
|
/** Video bytes.
|
|
7673
7723
|
* @remarks Encoded as base64 string. */
|
|
7674
7724
|
videoBytes?: string;
|
|
7675
|
-
/** Video encoding, for example
|
|
7725
|
+
/** Video encoding, for example ``video/mp4``. */
|
|
7676
7726
|
mimeType?: string;
|
|
7677
7727
|
}
|
|
7678
7728
|
|
|
@@ -7692,8 +7742,7 @@ export declare enum VideoCompressionQuality {
|
|
|
7692
7742
|
|
|
7693
7743
|
/** A reference image for video generation. */
|
|
7694
7744
|
export declare interface VideoGenerationReferenceImage {
|
|
7695
|
-
/** The reference image.
|
|
7696
|
-
*/
|
|
7745
|
+
/** The reference image. */
|
|
7697
7746
|
image?: Image_2;
|
|
7698
7747
|
/** The type of the reference image, which defines how the reference
|
|
7699
7748
|
image will be used to generate the video. */
|