@google/genai 1.15.0 → 1.17.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 +169 -149
- package/dist/index.cjs +307 -130
- package/dist/index.mjs +308 -131
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +308 -131
- package/dist/node/index.mjs +309 -132
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +169 -149
- package/dist/web/index.mjs +308 -131
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +169 -149
- package/package.json +3 -3
package/dist/web/web.d.ts
CHANGED
|
@@ -817,6 +817,27 @@ export declare interface CancelBatchJobParameters {
|
|
|
817
817
|
config?: CancelBatchJobConfig;
|
|
818
818
|
}
|
|
819
819
|
|
|
820
|
+
/** Optional parameters for tunings.cancel method. */
|
|
821
|
+
export declare interface CancelTuningJobConfig {
|
|
822
|
+
/** Used to override HTTP request options. */
|
|
823
|
+
httpOptions?: HttpOptions;
|
|
824
|
+
/** Abort signal which can be used to cancel the request.
|
|
825
|
+
|
|
826
|
+
NOTE: AbortSignal is a client-only operation. Using it to cancel an
|
|
827
|
+
operation will not cancel the request in the service. You will still
|
|
828
|
+
be charged usage for any applicable operations.
|
|
829
|
+
*/
|
|
830
|
+
abortSignal?: AbortSignal;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/** Parameters for the cancel method. */
|
|
834
|
+
export declare interface CancelTuningJobParameters {
|
|
835
|
+
/** The resource name of the tuning job. */
|
|
836
|
+
name: string;
|
|
837
|
+
/** Optional parameters for the request. */
|
|
838
|
+
config?: CancelTuningJobConfig;
|
|
839
|
+
}
|
|
840
|
+
|
|
820
841
|
/** A response candidate generated from the model. */
|
|
821
842
|
export declare interface Candidate {
|
|
822
843
|
/** Contains the multi-part content of the response.
|
|
@@ -1561,6 +1582,8 @@ export declare interface DeleteCachedContentParameters {
|
|
|
1561
1582
|
|
|
1562
1583
|
/** Empty response for caches.delete method. */
|
|
1563
1584
|
export declare class DeleteCachedContentResponse {
|
|
1585
|
+
/** Used to retain the full HTTP response. */
|
|
1586
|
+
sdkHttpResponse?: HttpResponse;
|
|
1564
1587
|
}
|
|
1565
1588
|
|
|
1566
1589
|
/** Used to override the default configuration. */
|
|
@@ -1586,6 +1609,8 @@ export declare interface DeleteFileParameters {
|
|
|
1586
1609
|
|
|
1587
1610
|
/** Response for the delete file method. */
|
|
1588
1611
|
export declare class DeleteFileResponse {
|
|
1612
|
+
/** Used to retain the full HTTP response. */
|
|
1613
|
+
sdkHttpResponse?: HttpResponse;
|
|
1589
1614
|
}
|
|
1590
1615
|
|
|
1591
1616
|
/** Configuration for deleting a tuned model. */
|
|
@@ -1609,6 +1634,8 @@ export declare interface DeleteModelParameters {
|
|
|
1609
1634
|
}
|
|
1610
1635
|
|
|
1611
1636
|
export declare class DeleteModelResponse {
|
|
1637
|
+
/** Used to retain the full HTTP response. */
|
|
1638
|
+
sdkHttpResponse?: HttpResponse;
|
|
1612
1639
|
}
|
|
1613
1640
|
|
|
1614
1641
|
/** The return value of delete operation. */
|
|
@@ -1693,54 +1720,40 @@ export declare interface EditImageConfig {
|
|
|
1693
1720
|
be charged usage for any applicable operations.
|
|
1694
1721
|
*/
|
|
1695
1722
|
abortSignal?: AbortSignal;
|
|
1696
|
-
/** Cloud Storage URI used to store the generated images.
|
|
1697
|
-
*/
|
|
1723
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
1698
1724
|
outputGcsUri?: string;
|
|
1699
|
-
/** Description of what to discourage in the generated images.
|
|
1700
|
-
*/
|
|
1725
|
+
/** Description of what to discourage in the generated images. */
|
|
1701
1726
|
negativePrompt?: string;
|
|
1702
|
-
/** Number of images to generate.
|
|
1703
|
-
*/
|
|
1727
|
+
/** Number of images to generate. */
|
|
1704
1728
|
numberOfImages?: number;
|
|
1705
1729
|
/** Aspect ratio of the generated images. Supported values are
|
|
1706
|
-
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
|
1707
|
-
*/
|
|
1730
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9". */
|
|
1708
1731
|
aspectRatio?: string;
|
|
1709
1732
|
/** Controls how much the model adheres to the text prompt. Large
|
|
1710
1733
|
values increase output and prompt alignment, but may compromise image
|
|
1711
|
-
quality.
|
|
1712
|
-
*/
|
|
1734
|
+
quality. */
|
|
1713
1735
|
guidanceScale?: number;
|
|
1714
1736
|
/** Random seed for image generation. This is not available when
|
|
1715
|
-
``add_watermark`` is set to true.
|
|
1716
|
-
*/
|
|
1737
|
+
``add_watermark`` is set to true. */
|
|
1717
1738
|
seed?: number;
|
|
1718
|
-
/** Filter level for safety filtering.
|
|
1719
|
-
*/
|
|
1739
|
+
/** Filter level for safety filtering. */
|
|
1720
1740
|
safetyFilterLevel?: SafetyFilterLevel;
|
|
1721
|
-
/** Allows generation of people by the model.
|
|
1722
|
-
*/
|
|
1741
|
+
/** Allows generation of people by the model. */
|
|
1723
1742
|
personGeneration?: PersonGeneration;
|
|
1724
1743
|
/** Whether to report the safety scores of each generated image and
|
|
1725
|
-
the positive prompt in the response.
|
|
1726
|
-
*/
|
|
1744
|
+
the positive prompt in the response. */
|
|
1727
1745
|
includeSafetyAttributes?: boolean;
|
|
1728
1746
|
/** Whether to include the Responsible AI filter reason if the image
|
|
1729
|
-
is filtered out of the response.
|
|
1730
|
-
*/
|
|
1747
|
+
is filtered out of the response. */
|
|
1731
1748
|
includeRaiReason?: boolean;
|
|
1732
|
-
/** Language of the text in the prompt.
|
|
1733
|
-
*/
|
|
1749
|
+
/** Language of the text in the prompt. */
|
|
1734
1750
|
language?: ImagePromptLanguage;
|
|
1735
|
-
/** MIME type of the generated image.
|
|
1736
|
-
*/
|
|
1751
|
+
/** MIME type of the generated image. */
|
|
1737
1752
|
outputMimeType?: string;
|
|
1738
1753
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
1739
|
-
only).
|
|
1740
|
-
*/
|
|
1754
|
+
only). */
|
|
1741
1755
|
outputCompressionQuality?: number;
|
|
1742
|
-
/** Whether to add a watermark to the generated images.
|
|
1743
|
-
*/
|
|
1756
|
+
/** Whether to add a watermark to the generated images. */
|
|
1744
1757
|
addWatermark?: boolean;
|
|
1745
1758
|
/** Describes the editing mode for the request. */
|
|
1746
1759
|
editMode?: EditMode;
|
|
@@ -1769,7 +1782,7 @@ export declare class EditImageResponse {
|
|
|
1769
1782
|
generatedImages?: GeneratedImage[];
|
|
1770
1783
|
}
|
|
1771
1784
|
|
|
1772
|
-
/** Enum representing the
|
|
1785
|
+
/** Enum representing the editing mode. */
|
|
1773
1786
|
export declare enum EditMode {
|
|
1774
1787
|
EDIT_MODE_DEFAULT = "EDIT_MODE_DEFAULT",
|
|
1775
1788
|
EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
|
|
@@ -2268,7 +2281,11 @@ export declare enum FunctionCallingConfigMode {
|
|
|
2268
2281
|
/**
|
|
2269
2282
|
* Model will not predict any function calls. Model behavior is same as when not passing any function declarations.
|
|
2270
2283
|
*/
|
|
2271
|
-
NONE = "NONE"
|
|
2284
|
+
NONE = "NONE",
|
|
2285
|
+
/**
|
|
2286
|
+
* Model decides to predict either a function call or a natural language response, but will validate function calls with constrained decoding. If "allowed_function_names" are set, the predicted function call will be limited to any one of "allowed_function_names", else the predicted function call will be any one of the provided "function_declarations".
|
|
2287
|
+
*/
|
|
2288
|
+
VALIDATED = "VALIDATED"
|
|
2272
2289
|
}
|
|
2273
2290
|
|
|
2274
2291
|
/** Defines a function that the model can generate JSON inputs for.
|
|
@@ -2693,20 +2710,16 @@ export declare class GenerateContentResponseUsageMetadata {
|
|
|
2693
2710
|
|
|
2694
2711
|
/** An output image. */
|
|
2695
2712
|
export declare interface GeneratedImage {
|
|
2696
|
-
/** The output image data.
|
|
2697
|
-
*/
|
|
2713
|
+
/** The output image data. */
|
|
2698
2714
|
image?: Image_2;
|
|
2699
2715
|
/** Responsible AI filter reason if the image is filtered out of the
|
|
2700
|
-
response.
|
|
2701
|
-
*/
|
|
2716
|
+
response. */
|
|
2702
2717
|
raiFilteredReason?: string;
|
|
2703
2718
|
/** Safety attributes of the image. Lists of RAI categories and their
|
|
2704
|
-
scores of each content.
|
|
2705
|
-
*/
|
|
2719
|
+
scores of each content. */
|
|
2706
2720
|
safetyAttributes?: SafetyAttributes;
|
|
2707
2721
|
/** The rewritten prompt used for the image generation if the prompt
|
|
2708
|
-
enhancer is enabled.
|
|
2709
|
-
*/
|
|
2722
|
+
enhancer is enabled. */
|
|
2710
2723
|
enhancedPrompt?: string;
|
|
2711
2724
|
}
|
|
2712
2725
|
|
|
@@ -2735,61 +2748,45 @@ export declare interface GenerateImagesConfig {
|
|
|
2735
2748
|
be charged usage for any applicable operations.
|
|
2736
2749
|
*/
|
|
2737
2750
|
abortSignal?: AbortSignal;
|
|
2738
|
-
/** Cloud Storage URI used to store the generated images.
|
|
2739
|
-
*/
|
|
2751
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
2740
2752
|
outputGcsUri?: string;
|
|
2741
|
-
/** Description of what to discourage in the generated images.
|
|
2742
|
-
*/
|
|
2753
|
+
/** Description of what to discourage in the generated images. */
|
|
2743
2754
|
negativePrompt?: string;
|
|
2744
|
-
/** Number of images to generate.
|
|
2745
|
-
*/
|
|
2755
|
+
/** Number of images to generate. */
|
|
2746
2756
|
numberOfImages?: number;
|
|
2747
2757
|
/** Aspect ratio of the generated images. Supported values are
|
|
2748
|
-
"1:1", "3:4", "4:3", "9:16", and "16:9".
|
|
2749
|
-
*/
|
|
2758
|
+
"1:1", "3:4", "4:3", "9:16", and "16:9". */
|
|
2750
2759
|
aspectRatio?: string;
|
|
2751
2760
|
/** Controls how much the model adheres to the text prompt. Large
|
|
2752
2761
|
values increase output and prompt alignment, but may compromise image
|
|
2753
|
-
quality.
|
|
2754
|
-
*/
|
|
2762
|
+
quality. */
|
|
2755
2763
|
guidanceScale?: number;
|
|
2756
2764
|
/** Random seed for image generation. This is not available when
|
|
2757
|
-
``add_watermark`` is set to true.
|
|
2758
|
-
*/
|
|
2765
|
+
``add_watermark`` is set to true. */
|
|
2759
2766
|
seed?: number;
|
|
2760
|
-
/** Filter level for safety filtering.
|
|
2761
|
-
*/
|
|
2767
|
+
/** Filter level for safety filtering. */
|
|
2762
2768
|
safetyFilterLevel?: SafetyFilterLevel;
|
|
2763
|
-
/** Allows generation of people by the model.
|
|
2764
|
-
*/
|
|
2769
|
+
/** Allows generation of people by the model. */
|
|
2765
2770
|
personGeneration?: PersonGeneration;
|
|
2766
2771
|
/** Whether to report the safety scores of each generated image and
|
|
2767
|
-
the positive prompt in the response.
|
|
2768
|
-
*/
|
|
2772
|
+
the positive prompt in the response. */
|
|
2769
2773
|
includeSafetyAttributes?: boolean;
|
|
2770
2774
|
/** Whether to include the Responsible AI filter reason if the image
|
|
2771
|
-
is filtered out of the response.
|
|
2772
|
-
*/
|
|
2775
|
+
is filtered out of the response. */
|
|
2773
2776
|
includeRaiReason?: boolean;
|
|
2774
|
-
/** Language of the text in the prompt.
|
|
2775
|
-
*/
|
|
2777
|
+
/** Language of the text in the prompt. */
|
|
2776
2778
|
language?: ImagePromptLanguage;
|
|
2777
|
-
/** MIME type of the generated image.
|
|
2778
|
-
*/
|
|
2779
|
+
/** MIME type of the generated image. */
|
|
2779
2780
|
outputMimeType?: string;
|
|
2780
2781
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
2781
|
-
only).
|
|
2782
|
-
*/
|
|
2782
|
+
only). */
|
|
2783
2783
|
outputCompressionQuality?: number;
|
|
2784
|
-
/** Whether to add a watermark to the generated images.
|
|
2785
|
-
*/
|
|
2784
|
+
/** Whether to add a watermark to the generated images. */
|
|
2786
2785
|
addWatermark?: boolean;
|
|
2787
2786
|
/** The size of the largest dimension of the generated image.
|
|
2788
|
-
Supported sizes are 1K and 2K (not supported for Imagen 3 models).
|
|
2789
|
-
*/
|
|
2787
|
+
Supported sizes are 1K and 2K (not supported for Imagen 3 models). */
|
|
2790
2788
|
imageSize?: string;
|
|
2791
|
-
/** Whether to use the prompt rewriting logic.
|
|
2792
|
-
*/
|
|
2789
|
+
/** Whether to use the prompt rewriting logic. */
|
|
2793
2790
|
enhancePrompt?: boolean;
|
|
2794
2791
|
}
|
|
2795
2792
|
|
|
@@ -2810,12 +2807,10 @@ export declare interface GenerateImagesParameters {
|
|
|
2810
2807
|
export declare class GenerateImagesResponse {
|
|
2811
2808
|
/** Used to retain the full HTTP response. */
|
|
2812
2809
|
sdkHttpResponse?: HttpResponse;
|
|
2813
|
-
/** List of generated images.
|
|
2814
|
-
*/
|
|
2810
|
+
/** List of generated images. */
|
|
2815
2811
|
generatedImages?: GeneratedImage[];
|
|
2816
2812
|
/** Safety attributes of the positive prompt. Only populated if
|
|
2817
|
-
``include_safety_attributes`` is set to True.
|
|
2818
|
-
*/
|
|
2813
|
+
``include_safety_attributes`` is set to True. */
|
|
2819
2814
|
positivePromptSafetyAttributes?: SafetyAttributes;
|
|
2820
2815
|
}
|
|
2821
2816
|
|
|
@@ -2838,23 +2833,32 @@ export declare interface GenerateVideosConfig {
|
|
|
2838
2833
|
fps?: number;
|
|
2839
2834
|
/** Duration of the clip for video generation in seconds. */
|
|
2840
2835
|
durationSeconds?: number;
|
|
2841
|
-
/** The RNG seed. If RNG seed is exactly same for each request with
|
|
2836
|
+
/** The RNG seed. If RNG seed is exactly same for each request with
|
|
2837
|
+
unchanged inputs, the prediction results will be consistent. Otherwise,
|
|
2838
|
+
a random RNG seed will be used each time to produce a different
|
|
2839
|
+
result. */
|
|
2842
2840
|
seed?: number;
|
|
2843
|
-
/** The aspect ratio for the generated video. 16:9 (landscape) and
|
|
2841
|
+
/** The aspect ratio for the generated video. 16:9 (landscape) and
|
|
2842
|
+
9:16 (portrait) are supported. */
|
|
2844
2843
|
aspectRatio?: string;
|
|
2845
|
-
/** The resolution for the generated video. 720p and 1080p are
|
|
2844
|
+
/** The resolution for the generated video. 720p and 1080p are
|
|
2845
|
+
supported. */
|
|
2846
2846
|
resolution?: string;
|
|
2847
|
-
/** Whether allow to generate person videos, and restrict to specific
|
|
2847
|
+
/** Whether allow to generate person videos, and restrict to specific
|
|
2848
|
+
ages. Supported values are: dont_allow, allow_adult. */
|
|
2848
2849
|
personGeneration?: string;
|
|
2849
|
-
/** The pubsub topic where to publish the video generation
|
|
2850
|
+
/** The pubsub topic where to publish the video generation
|
|
2851
|
+
progress. */
|
|
2850
2852
|
pubsubTopic?: string;
|
|
2851
|
-
/**
|
|
2853
|
+
/** Explicitly state what should not be included in the generated
|
|
2854
|
+
videos. */
|
|
2852
2855
|
negativePrompt?: string;
|
|
2853
2856
|
/** Whether to use the prompt rewriting logic. */
|
|
2854
2857
|
enhancePrompt?: boolean;
|
|
2855
2858
|
/** Whether to generate audio along with the video. */
|
|
2856
2859
|
generateAudio?: boolean;
|
|
2857
|
-
/** Image to use as the last frame of generated videos.
|
|
2860
|
+
/** Image to use as the last frame of generated videos.
|
|
2861
|
+
Only supported for image to video use cases. */
|
|
2858
2862
|
lastFrame?: Image_2;
|
|
2859
2863
|
/** The images to use as the references to generate the videos.
|
|
2860
2864
|
If this field is provided, the text prompt field must also be provided.
|
|
@@ -2866,7 +2870,7 @@ export declare interface GenerateVideosConfig {
|
|
|
2866
2870
|
compressionQuality?: VideoCompressionQuality;
|
|
2867
2871
|
}
|
|
2868
2872
|
|
|
2869
|
-
/** A video generation
|
|
2873
|
+
/** A video generation operation. */
|
|
2870
2874
|
export declare class GenerateVideosOperation implements Operation<GenerateVideosResponse> {
|
|
2871
2875
|
/** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */
|
|
2872
2876
|
name?: string;
|
|
@@ -2876,7 +2880,7 @@ export declare class GenerateVideosOperation implements Operation<GenerateVideos
|
|
|
2876
2880
|
done?: boolean;
|
|
2877
2881
|
/** The error result of the operation in case of failure or cancellation. */
|
|
2878
2882
|
error?: Record<string, unknown>;
|
|
2879
|
-
/** The
|
|
2883
|
+
/** The generated videos. */
|
|
2880
2884
|
response?: GenerateVideosResponse;
|
|
2881
2885
|
/** The full HTTP response. */
|
|
2882
2886
|
sdkHttpResponse?: HttpResponse;
|
|
@@ -2892,14 +2896,17 @@ export declare interface GenerateVideosParameters {
|
|
|
2892
2896
|
/** ID of the model to use. For a list of models, see `Google models
|
|
2893
2897
|
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_. */
|
|
2894
2898
|
model: string;
|
|
2895
|
-
/** The text prompt for generating the videos.
|
|
2899
|
+
/** The text prompt for generating the videos.
|
|
2900
|
+
Optional if image or video is provided. */
|
|
2896
2901
|
prompt?: string;
|
|
2897
2902
|
/** The input image for generating the videos.
|
|
2898
|
-
Optional if prompt
|
|
2903
|
+
Optional if prompt is provided. Not allowed if video is provided. */
|
|
2899
2904
|
image?: Image_2;
|
|
2900
2905
|
/** The input video for video extension use cases.
|
|
2901
|
-
Optional if prompt
|
|
2906
|
+
Optional if prompt is provided. Not allowed if image is provided. */
|
|
2902
2907
|
video?: Video;
|
|
2908
|
+
/** A set of source input(s) for video generation. */
|
|
2909
|
+
source?: GenerateVideosSource;
|
|
2903
2910
|
/** Configuration for generating videos. */
|
|
2904
2911
|
config?: GenerateVideosConfig;
|
|
2905
2912
|
}
|
|
@@ -2914,6 +2921,19 @@ export declare class GenerateVideosResponse {
|
|
|
2914
2921
|
raiMediaFilteredReasons?: string[];
|
|
2915
2922
|
}
|
|
2916
2923
|
|
|
2924
|
+
/** A set of source input(s) for video generation. */
|
|
2925
|
+
export declare interface GenerateVideosSource {
|
|
2926
|
+
/** The text prompt for generating the videos.
|
|
2927
|
+
Optional if image or video is provided. */
|
|
2928
|
+
prompt?: string;
|
|
2929
|
+
/** The input image for generating the videos.
|
|
2930
|
+
Optional if prompt is provided. Not allowed if video is provided. */
|
|
2931
|
+
image?: Image_2;
|
|
2932
|
+
/** The input video for video extension use cases.
|
|
2933
|
+
Optional if prompt is provided. Not allowed if image is provided. */
|
|
2934
|
+
video?: Video;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2917
2937
|
/** Generation config. */
|
|
2918
2938
|
export declare interface GenerationConfig {
|
|
2919
2939
|
/** Optional. Config for model selection. */
|
|
@@ -3097,7 +3117,6 @@ export declare interface GetOperationParameters {
|
|
|
3097
3117
|
config?: GetOperationConfig;
|
|
3098
3118
|
}
|
|
3099
3119
|
|
|
3100
|
-
/** Optional parameters for tunings.get method. */
|
|
3101
3120
|
export declare interface GetTuningJobConfig {
|
|
3102
3121
|
/** Used to override HTTP request options. */
|
|
3103
3122
|
httpOptions?: HttpOptions;
|
|
@@ -3601,12 +3620,10 @@ export declare class HttpResponse {
|
|
|
3601
3620
|
/** An image. */
|
|
3602
3621
|
declare interface Image_2 {
|
|
3603
3622
|
/** The Cloud Storage URI of the image. ``Image`` can contain a value
|
|
3604
|
-
for this field or the ``image_bytes`` field but not both.
|
|
3605
|
-
*/
|
|
3623
|
+
for this field or the ``image_bytes`` field but not both. */
|
|
3606
3624
|
gcsUri?: string;
|
|
3607
3625
|
/** The image bytes data. ``Image`` can contain a value for this field
|
|
3608
3626
|
or the ``gcs_uri`` field but not both.
|
|
3609
|
-
|
|
3610
3627
|
* @remarks Encoded as base64 string. */
|
|
3611
3628
|
imageBytes?: string;
|
|
3612
3629
|
/** The MIME type of the image. */
|
|
@@ -4657,6 +4674,7 @@ export declare interface LiveServerSessionResumptionUpdate {
|
|
|
4657
4674
|
lastConsumedClientMessageIndex?: string;
|
|
4658
4675
|
}
|
|
4659
4676
|
|
|
4677
|
+
/** Sent in response to a `LiveGenerateContentSetup` message from the client. */
|
|
4660
4678
|
export declare interface LiveServerSetupComplete {
|
|
4661
4679
|
/** The session id of the live session. */
|
|
4662
4680
|
sessionId?: string;
|
|
@@ -5055,7 +5073,9 @@ export declare class Models extends BaseModule {
|
|
|
5055
5073
|
* ```ts
|
|
5056
5074
|
* const operation = await ai.models.generateVideos({
|
|
5057
5075
|
* model: 'veo-2.0-generate-001',
|
|
5058
|
-
*
|
|
5076
|
+
* source: {
|
|
5077
|
+
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5078
|
+
* },
|
|
5059
5079
|
* config: {
|
|
5060
5080
|
* numberOfVideos: 1
|
|
5061
5081
|
* });
|
|
@@ -5094,26 +5114,16 @@ export declare class Models extends BaseModule {
|
|
|
5094
5114
|
*/
|
|
5095
5115
|
embedContent(params: types.EmbedContentParameters): Promise<types.EmbedContentResponse>;
|
|
5096
5116
|
/**
|
|
5097
|
-
*
|
|
5098
|
-
*
|
|
5099
|
-
* @param params - The parameters for generating images.
|
|
5100
|
-
* @return The response from the API.
|
|
5101
|
-
*
|
|
5102
|
-
* @example
|
|
5103
|
-
* ```ts
|
|
5104
|
-
* const response = await ai.models.generateImages({
|
|
5105
|
-
* model: 'imagen-3.0-generate-002',
|
|
5106
|
-
* prompt: 'Robot holding a red skateboard',
|
|
5107
|
-
* config: {
|
|
5108
|
-
* numberOfImages: 1,
|
|
5109
|
-
* includeRaiReason: true,
|
|
5110
|
-
* },
|
|
5111
|
-
* });
|
|
5112
|
-
* console.log(response?.generatedImages?.[0]?.image?.imageBytes);
|
|
5113
|
-
* ```
|
|
5117
|
+
* Private method for generating images.
|
|
5114
5118
|
*/
|
|
5115
5119
|
private generateImagesInternal;
|
|
5120
|
+
/**
|
|
5121
|
+
* Private method for editing an image.
|
|
5122
|
+
*/
|
|
5116
5123
|
private editImageInternal;
|
|
5124
|
+
/**
|
|
5125
|
+
* Private method for upscaling an image.
|
|
5126
|
+
*/
|
|
5117
5127
|
private upscaleImageInternal;
|
|
5118
5128
|
/**
|
|
5119
5129
|
* Recontextualizes an image.
|
|
@@ -5252,27 +5262,7 @@ export declare class Models extends BaseModule {
|
|
|
5252
5262
|
*/
|
|
5253
5263
|
computeTokens(params: types.ComputeTokensParameters): Promise<types.ComputeTokensResponse>;
|
|
5254
5264
|
/**
|
|
5255
|
-
*
|
|
5256
|
-
*
|
|
5257
|
-
* @param params - The parameters for generating videos.
|
|
5258
|
-
* @return A Promise<GenerateVideosOperation> which allows you to track the progress and eventually retrieve the generated videos using the operations.get method.
|
|
5259
|
-
*
|
|
5260
|
-
* @example
|
|
5261
|
-
* ```ts
|
|
5262
|
-
* const operation = await ai.models.generateVideos({
|
|
5263
|
-
* model: 'veo-2.0-generate-001',
|
|
5264
|
-
* prompt: 'A neon hologram of a cat driving at top speed',
|
|
5265
|
-
* config: {
|
|
5266
|
-
* numberOfVideos: 1
|
|
5267
|
-
* });
|
|
5268
|
-
*
|
|
5269
|
-
* while (!operation.done) {
|
|
5270
|
-
* await new Promise(resolve => setTimeout(resolve, 10000));
|
|
5271
|
-
* operation = await ai.operations.getVideosOperation({operation: operation});
|
|
5272
|
-
* }
|
|
5273
|
-
*
|
|
5274
|
-
* console.log(operation.response?.generatedVideos?.[0]?.video?.uri);
|
|
5275
|
-
* ```
|
|
5265
|
+
* Private method for generating videos.
|
|
5276
5266
|
*/
|
|
5277
5267
|
private generateVideosInternal;
|
|
5278
5268
|
}
|
|
@@ -5341,10 +5331,10 @@ export declare interface OperationFromAPIResponseParameters {
|
|
|
5341
5331
|
|
|
5342
5332
|
/** Parameters for the get method of the operations module. */
|
|
5343
5333
|
export declare interface OperationGetParameters<T, U extends Operation<T>> {
|
|
5344
|
-
/** The operation to be retrieved. */
|
|
5345
|
-
operation: U;
|
|
5346
5334
|
/** Used to override the default configuration. */
|
|
5347
5335
|
config?: GetOperationConfig;
|
|
5336
|
+
/** The operation to be retrieved. */
|
|
5337
|
+
operation: U;
|
|
5348
5338
|
}
|
|
5349
5339
|
|
|
5350
5340
|
export declare class Operations extends BaseModule {
|
|
@@ -5743,6 +5733,8 @@ export declare interface RecontextImageConfig {
|
|
|
5743
5733
|
/** Whether allow to generate person images, and restrict to specific
|
|
5744
5734
|
ages. */
|
|
5745
5735
|
personGeneration?: PersonGeneration;
|
|
5736
|
+
/** Whether to add a SynthID watermark to the generated images. */
|
|
5737
|
+
addWatermark?: boolean;
|
|
5746
5738
|
/** MIME type of the generated image. */
|
|
5747
5739
|
outputMimeType?: string;
|
|
5748
5740
|
/** Compression quality of the generated image (for ``image/jpeg``
|
|
@@ -5858,14 +5850,11 @@ export declare interface RetrievalMetadata {
|
|
|
5858
5850
|
|
|
5859
5851
|
/** Safety attributes of a GeneratedImage or the user-provided prompt. */
|
|
5860
5852
|
export declare interface SafetyAttributes {
|
|
5861
|
-
/** List of RAI categories.
|
|
5862
|
-
*/
|
|
5853
|
+
/** List of RAI categories. */
|
|
5863
5854
|
categories?: string[];
|
|
5864
|
-
/** List of scores of each categories.
|
|
5865
|
-
*/
|
|
5855
|
+
/** List of scores of each categories. */
|
|
5866
5856
|
scores?: number[];
|
|
5867
|
-
/** Internal use only.
|
|
5868
|
-
*/
|
|
5857
|
+
/** Internal use only. */
|
|
5869
5858
|
contentType?: string;
|
|
5870
5859
|
}
|
|
5871
5860
|
|
|
@@ -6627,7 +6616,7 @@ export declare class Tokens extends BaseModule {
|
|
|
6627
6616
|
|
|
6628
6617
|
/** Tokens info with a list of tokens and the corresponding list of token ids. */
|
|
6629
6618
|
export declare interface TokensInfo {
|
|
6630
|
-
/** Optional
|
|
6619
|
+
/** Optional fields for the role from the corresponding Content. */
|
|
6631
6620
|
role?: string;
|
|
6632
6621
|
/** A list of token ids from the input. */
|
|
6633
6622
|
tokenIds?: string[];
|
|
@@ -6894,6 +6883,18 @@ declare class Tunings extends BaseModule {
|
|
|
6894
6883
|
tune: (params: types.CreateTuningJobParameters) => Promise<types.TuningJob>;
|
|
6895
6884
|
private getInternal;
|
|
6896
6885
|
private listInternal;
|
|
6886
|
+
/**
|
|
6887
|
+
* Cancels a tuning job.
|
|
6888
|
+
*
|
|
6889
|
+
* @param params - The parameters for the cancel request.
|
|
6890
|
+
* @return The empty response returned by the API.
|
|
6891
|
+
*
|
|
6892
|
+
* @example
|
|
6893
|
+
* ```ts
|
|
6894
|
+
* await ai.tunings.cancel({name: '...'}); // The server-generated resource name.
|
|
6895
|
+
* ```
|
|
6896
|
+
*/
|
|
6897
|
+
cancel(params: types.CancelTuningJobParameters): Promise<void>;
|
|
6897
6898
|
private tuneInternal;
|
|
6898
6899
|
private tuneMldevInternal;
|
|
6899
6900
|
}
|
|
@@ -7001,6 +7002,7 @@ declare namespace types {
|
|
|
7001
7002
|
SubjectReferenceType,
|
|
7002
7003
|
EditMode,
|
|
7003
7004
|
SegmentMode,
|
|
7005
|
+
VideoGenerationReferenceType,
|
|
7004
7006
|
VideoCompressionQuality,
|
|
7005
7007
|
FileState,
|
|
7006
7008
|
FileSource,
|
|
@@ -7162,11 +7164,14 @@ declare namespace types {
|
|
|
7162
7164
|
TokensInfo,
|
|
7163
7165
|
ComputeTokensResponse,
|
|
7164
7166
|
Video,
|
|
7167
|
+
GenerateVideosSource,
|
|
7165
7168
|
VideoGenerationReferenceImage,
|
|
7166
7169
|
GenerateVideosConfig,
|
|
7167
7170
|
GenerateVideosParameters,
|
|
7168
7171
|
GeneratedVideo,
|
|
7169
7172
|
GenerateVideosResponse,
|
|
7173
|
+
Operation,
|
|
7174
|
+
GenerateVideosOperation,
|
|
7170
7175
|
GetTuningJobConfig,
|
|
7171
7176
|
GetTuningJobParameters,
|
|
7172
7177
|
TunedModelCheckpoint,
|
|
@@ -7192,6 +7197,8 @@ declare namespace types {
|
|
|
7192
7197
|
ListTuningJobsConfig,
|
|
7193
7198
|
ListTuningJobsParameters,
|
|
7194
7199
|
ListTuningJobsResponse,
|
|
7200
|
+
CancelTuningJobConfig,
|
|
7201
|
+
CancelTuningJobParameters,
|
|
7195
7202
|
TuningExample,
|
|
7196
7203
|
TuningDataset,
|
|
7197
7204
|
TuningValidationDataset,
|
|
@@ -7272,10 +7279,7 @@ declare namespace types {
|
|
|
7272
7279
|
LiveServerGoAway,
|
|
7273
7280
|
LiveServerSessionResumptionUpdate,
|
|
7274
7281
|
LiveServerMessage,
|
|
7275
|
-
OperationGetParameters,
|
|
7276
7282
|
OperationFromAPIResponseParameters,
|
|
7277
|
-
Operation,
|
|
7278
|
-
GenerateVideosOperation,
|
|
7279
7283
|
AutomaticActivityDetection,
|
|
7280
7284
|
RealtimeInputConfig,
|
|
7281
7285
|
SessionResumptionConfig,
|
|
@@ -7319,6 +7323,7 @@ declare namespace types {
|
|
|
7319
7323
|
LiveConnectConstraints,
|
|
7320
7324
|
CreateAuthTokenConfig,
|
|
7321
7325
|
CreateAuthTokenParameters,
|
|
7326
|
+
OperationGetParameters,
|
|
7322
7327
|
CreateTuningJobParameters,
|
|
7323
7328
|
BlobImageUnion,
|
|
7324
7329
|
PartUnion,
|
|
@@ -7449,13 +7454,15 @@ export declare interface UpscaleImageConfig {
|
|
|
7449
7454
|
be charged usage for any applicable operations.
|
|
7450
7455
|
*/
|
|
7451
7456
|
abortSignal?: AbortSignal;
|
|
7457
|
+
/** Cloud Storage URI used to store the generated images. */
|
|
7458
|
+
outputGcsUri?: string;
|
|
7452
7459
|
/** Whether to include a reason for filtered-out images in the
|
|
7453
7460
|
response. */
|
|
7454
7461
|
includeRaiReason?: boolean;
|
|
7455
7462
|
/** The image format that the output should be saved as. */
|
|
7456
7463
|
outputMimeType?: string;
|
|
7457
|
-
/** The level of compression if the
|
|
7458
|
-
``image/jpeg``. */
|
|
7464
|
+
/** The level of compression. Only applicable if the
|
|
7465
|
+
``output_mime_type`` is ``image/jpeg``. */
|
|
7459
7466
|
outputCompressionQuality?: number;
|
|
7460
7467
|
/** Whether to add an image enhancing step before upscaling.
|
|
7461
7468
|
It is expected to suppress the noise and JPEG compression artifacts
|
|
@@ -7609,7 +7616,7 @@ export declare interface Video {
|
|
|
7609
7616
|
/** Video bytes.
|
|
7610
7617
|
* @remarks Encoded as base64 string. */
|
|
7611
7618
|
videoBytes?: string;
|
|
7612
|
-
/** Video encoding, for example
|
|
7619
|
+
/** Video encoding, for example ``video/mp4``. */
|
|
7613
7620
|
mimeType?: string;
|
|
7614
7621
|
}
|
|
7615
7622
|
|
|
@@ -7629,13 +7636,26 @@ export declare enum VideoCompressionQuality {
|
|
|
7629
7636
|
|
|
7630
7637
|
/** A reference image for video generation. */
|
|
7631
7638
|
export declare interface VideoGenerationReferenceImage {
|
|
7632
|
-
/** The reference image.
|
|
7633
|
-
*/
|
|
7639
|
+
/** The reference image. */
|
|
7634
7640
|
image?: Image_2;
|
|
7635
7641
|
/** The type of the reference image, which defines how the reference
|
|
7636
|
-
image will be used to generate the video.
|
|
7637
|
-
|
|
7638
|
-
|
|
7642
|
+
image will be used to generate the video. */
|
|
7643
|
+
referenceType?: VideoGenerationReferenceType;
|
|
7644
|
+
}
|
|
7645
|
+
|
|
7646
|
+
/** Enum for the reference type of a video generation reference image. */
|
|
7647
|
+
export declare enum VideoGenerationReferenceType {
|
|
7648
|
+
/**
|
|
7649
|
+
* A reference image that provides assets to the generated video,
|
|
7650
|
+
such as the scene, an object, a character, etc.
|
|
7651
|
+
*/
|
|
7652
|
+
ASSET = "ASSET",
|
|
7653
|
+
/**
|
|
7654
|
+
* A reference image that provides aesthetics including colors,
|
|
7655
|
+
lighting, texture, etc., to be used as the style of the generated video,
|
|
7656
|
+
such as 'anime', 'photography', 'origami', etc.
|
|
7657
|
+
*/
|
|
7658
|
+
STYLE = "STYLE"
|
|
7639
7659
|
}
|
|
7640
7660
|
|
|
7641
7661
|
/** Describes how the video in the Part should be used by the model. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/genai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.mjs",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"prettier": "3.3.3",
|
|
95
95
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
96
96
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
97
|
-
"test-server-sdk": "^0.2.
|
|
97
|
+
"test-server-sdk": "^0.2.7",
|
|
98
98
|
"ts-node": "^10.9.2",
|
|
99
99
|
"tslib": "^2.8.1",
|
|
100
100
|
"tsx": "^4.19.4",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"ws": "^8.18.0"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
|
-
"@modelcontextprotocol/sdk": "^1.11.
|
|
112
|
+
"@modelcontextprotocol/sdk": "^1.11.4"
|
|
113
113
|
},
|
|
114
114
|
"peerDependenciesMeta": {
|
|
115
115
|
"@modelcontextprotocol/sdk": {
|