@google/genai 1.34.0 → 1.36.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 +151 -71
- package/dist/index.cjs +282 -251
- package/dist/index.mjs +283 -252
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +282 -251
- package/dist/node/index.mjs +283 -252
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +151 -71
- package/dist/tokenizer/node.cjs +5664 -0
- package/dist/tokenizer/node.d.ts +1145 -0
- package/dist/tokenizer/node.mjs +5640 -0
- package/dist/tokenizer/node.mjs.map +1 -0
- package/dist/web/index.mjs +283 -252
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +151 -71
- package/package.json +30 -3
package/dist/web/web.d.ts
CHANGED
|
@@ -417,11 +417,17 @@ export declare interface AudioChunk {
|
|
|
417
417
|
*/
|
|
418
418
|
declare interface AudioContent {
|
|
419
419
|
type: 'audio';
|
|
420
|
+
/**
|
|
421
|
+
* The audio content.
|
|
422
|
+
*/
|
|
420
423
|
data?: string;
|
|
421
424
|
/**
|
|
422
425
|
* The mime type of the audio.
|
|
423
426
|
*/
|
|
424
427
|
mime_type?: AudioMimeType;
|
|
428
|
+
/**
|
|
429
|
+
* The URI of the audio.
|
|
430
|
+
*/
|
|
425
431
|
uri?: string;
|
|
426
432
|
}
|
|
427
433
|
|
|
@@ -581,7 +587,7 @@ declare interface BaseCreateAgentInteractionParams {
|
|
|
581
587
|
/**
|
|
582
588
|
* Body param: The inputs for the interaction.
|
|
583
589
|
*/
|
|
584
|
-
input: string | Array<
|
|
590
|
+
input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
585
591
|
/**
|
|
586
592
|
* Path param: Which version of the API to use.
|
|
587
593
|
*/
|
|
@@ -633,7 +639,7 @@ declare interface BaseCreateModelInteractionParams {
|
|
|
633
639
|
/**
|
|
634
640
|
* Body param: The inputs for the interaction.
|
|
635
641
|
*/
|
|
636
|
-
input: string | Array<
|
|
642
|
+
input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
637
643
|
/**
|
|
638
644
|
* Body param: The name of the `Model` used for generating the interaction.
|
|
639
645
|
*/
|
|
@@ -1045,7 +1051,7 @@ export declare interface BatchJobSource {
|
|
|
1045
1051
|
|
|
1046
1052
|
export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
|
|
1047
1053
|
|
|
1048
|
-
/**
|
|
1054
|
+
/** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
|
|
1049
1055
|
export declare enum Behavior {
|
|
1050
1056
|
/**
|
|
1051
1057
|
* This value is unused.
|
|
@@ -1701,6 +1707,12 @@ export declare class ComputeTokensResponse {
|
|
|
1701
1707
|
tokensInfo?: TokensInfo[];
|
|
1702
1708
|
}
|
|
1703
1709
|
|
|
1710
|
+
/** Local tokenizer compute tokens result. */
|
|
1711
|
+
export declare interface ComputeTokensResult {
|
|
1712
|
+
/** Lists of tokens info from the input. */
|
|
1713
|
+
tokensInfo?: TokensInfo[];
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1704
1716
|
declare type _ConditionalNodeReadableStream<R = any> = typeof globalThis extends {
|
|
1705
1717
|
ReadableStream: any;
|
|
1706
1718
|
} ? never : _NodeReadableStream<R>;
|
|
@@ -1717,11 +1729,15 @@ export declare interface Content {
|
|
|
1717
1729
|
role?: string;
|
|
1718
1730
|
}
|
|
1719
1731
|
|
|
1732
|
+
/**
|
|
1733
|
+
* The content of the response.
|
|
1734
|
+
*/
|
|
1735
|
+
declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
1736
|
+
|
|
1720
1737
|
declare interface ContentDelta {
|
|
1721
|
-
delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchResultDelta;
|
|
1738
|
+
delta?: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchCallDelta | ContentDelta.FileSearchResultDelta;
|
|
1722
1739
|
/**
|
|
1723
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
1724
|
-
* this event.
|
|
1740
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
1725
1741
|
*/
|
|
1726
1742
|
event_id?: string;
|
|
1727
1743
|
event_type?: 'content.delta';
|
|
@@ -1917,6 +1933,13 @@ declare namespace ContentDelta {
|
|
|
1917
1933
|
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
1918
1934
|
}
|
|
1919
1935
|
}
|
|
1936
|
+
interface FileSearchCallDelta {
|
|
1937
|
+
type: 'file_search_call';
|
|
1938
|
+
/**
|
|
1939
|
+
* A unique ID for this specific tool call.
|
|
1940
|
+
*/
|
|
1941
|
+
id?: string;
|
|
1942
|
+
}
|
|
1920
1943
|
interface FileSearchResultDelta {
|
|
1921
1944
|
type: 'file_search_result';
|
|
1922
1945
|
result?: Array<FileSearchResultDelta.Result>;
|
|
@@ -1986,10 +2009,9 @@ declare interface ContentStart {
|
|
|
1986
2009
|
/**
|
|
1987
2010
|
* The content of the response.
|
|
1988
2011
|
*/
|
|
1989
|
-
content?:
|
|
2012
|
+
content?: Content_2;
|
|
1990
2013
|
/**
|
|
1991
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
1992
|
-
* this event.
|
|
2014
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
1993
2015
|
*/
|
|
1994
2016
|
event_id?: string;
|
|
1995
2017
|
event_type?: 'content.start';
|
|
@@ -1998,8 +2020,7 @@ declare interface ContentStart {
|
|
|
1998
2020
|
|
|
1999
2021
|
declare interface ContentStop {
|
|
2000
2022
|
/**
|
|
2001
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
2002
|
-
* this event.
|
|
2023
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2003
2024
|
*/
|
|
2004
2025
|
event_id?: string;
|
|
2005
2026
|
event_type?: 'content.stop';
|
|
@@ -2101,6 +2122,12 @@ export declare class CountTokensResponse {
|
|
|
2101
2122
|
cachedContentTokenCount?: number;
|
|
2102
2123
|
}
|
|
2103
2124
|
|
|
2125
|
+
/** Local tokenizer count tokens result. */
|
|
2126
|
+
export declare interface CountTokensResult {
|
|
2127
|
+
/** The total number of tokens. */
|
|
2128
|
+
totalTokens?: number;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2104
2131
|
declare interface CreateAgentInteractionParamsNonStreaming extends BaseCreateAgentInteractionParams {
|
|
2105
2132
|
/**
|
|
2106
2133
|
* Body param: Input only. Whether the interaction will be streamed.
|
|
@@ -2752,11 +2779,17 @@ export { Document_2 as Document }
|
|
|
2752
2779
|
*/
|
|
2753
2780
|
declare interface DocumentContent {
|
|
2754
2781
|
type: 'document';
|
|
2782
|
+
/**
|
|
2783
|
+
* The document content.
|
|
2784
|
+
*/
|
|
2755
2785
|
data?: string;
|
|
2756
2786
|
/**
|
|
2757
2787
|
* The mime type of the document.
|
|
2758
2788
|
*/
|
|
2759
2789
|
mime_type?: DocumentMimeType;
|
|
2790
|
+
/**
|
|
2791
|
+
* The URI of the document.
|
|
2792
|
+
*/
|
|
2760
2793
|
uri?: string;
|
|
2761
2794
|
}
|
|
2762
2795
|
|
|
@@ -2856,13 +2889,13 @@ declare interface DynamicAgentConfig {
|
|
|
2856
2889
|
|
|
2857
2890
|
/** Describes the options to customize dynamic retrieval. */
|
|
2858
2891
|
export declare interface DynamicRetrievalConfig {
|
|
2859
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2860
|
-
mode?: DynamicRetrievalConfigMode;
|
|
2861
2892
|
/** Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */
|
|
2862
2893
|
dynamicThreshold?: number;
|
|
2894
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2895
|
+
mode?: DynamicRetrievalConfigMode;
|
|
2863
2896
|
}
|
|
2864
2897
|
|
|
2865
|
-
/**
|
|
2898
|
+
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
2866
2899
|
export declare enum DynamicRetrievalConfigMode {
|
|
2867
2900
|
/**
|
|
2868
2901
|
* Always trigger retrieval.
|
|
@@ -3113,8 +3146,7 @@ declare interface ErrorEvent_2 {
|
|
|
3113
3146
|
*/
|
|
3114
3147
|
error?: ErrorEvent_2.Error;
|
|
3115
3148
|
/**
|
|
3116
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
3117
|
-
* this event.
|
|
3149
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
3118
3150
|
*/
|
|
3119
3151
|
event_id?: string;
|
|
3120
3152
|
event_type?: 'error';
|
|
@@ -3398,6 +3430,17 @@ export declare interface FileSearch {
|
|
|
3398
3430
|
metadataFilter?: string;
|
|
3399
3431
|
}
|
|
3400
3432
|
|
|
3433
|
+
/**
|
|
3434
|
+
* File Search content.
|
|
3435
|
+
*/
|
|
3436
|
+
declare interface FileSearchCallContent {
|
|
3437
|
+
type: 'file_search_call';
|
|
3438
|
+
/**
|
|
3439
|
+
* A unique ID for this specific tool call.
|
|
3440
|
+
*/
|
|
3441
|
+
id?: string;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3401
3444
|
/**
|
|
3402
3445
|
* File Search result content.
|
|
3403
3446
|
*/
|
|
@@ -3543,7 +3586,8 @@ declare class FileSearchStores extends BaseModule {
|
|
|
3543
3586
|
export declare enum FileSource {
|
|
3544
3587
|
SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
|
|
3545
3588
|
UPLOADED = "UPLOADED",
|
|
3546
|
-
GENERATED = "GENERATED"
|
|
3589
|
+
GENERATED = "GENERATED",
|
|
3590
|
+
REGISTERED = "REGISTERED"
|
|
3547
3591
|
}
|
|
3548
3592
|
|
|
3549
3593
|
/**
|
|
@@ -3721,18 +3765,18 @@ declare interface FunctionCallContent {
|
|
|
3721
3765
|
|
|
3722
3766
|
/** Function calling config. */
|
|
3723
3767
|
export declare interface FunctionCallingConfig {
|
|
3724
|
-
/** Optional. Function calling mode. */
|
|
3725
|
-
mode?: FunctionCallingConfigMode;
|
|
3726
3768
|
/** Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided. */
|
|
3727
3769
|
allowedFunctionNames?: string[];
|
|
3770
|
+
/** Optional. Function calling mode. */
|
|
3771
|
+
mode?: FunctionCallingConfigMode;
|
|
3728
3772
|
/** Optional. When set to true, arguments of a single function call will be streamed out in multiple parts/contents/responses. Partial parameter results will be returned in the [FunctionCall.partial_args] field. This field is not supported in Gemini API. */
|
|
3729
3773
|
streamFunctionCallArguments?: boolean;
|
|
3730
3774
|
}
|
|
3731
3775
|
|
|
3732
|
-
/**
|
|
3776
|
+
/** Function calling mode. */
|
|
3733
3777
|
export declare enum FunctionCallingConfigMode {
|
|
3734
3778
|
/**
|
|
3735
|
-
*
|
|
3779
|
+
* Unspecified function calling mode. This value should not be used.
|
|
3736
3780
|
*/
|
|
3737
3781
|
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
3738
3782
|
/**
|
|
@@ -3748,18 +3792,13 @@ export declare enum FunctionCallingConfigMode {
|
|
|
3748
3792
|
*/
|
|
3749
3793
|
NONE = "NONE",
|
|
3750
3794
|
/**
|
|
3751
|
-
* Model
|
|
3795
|
+
* Model is constrained to predict either function calls or natural language response. If "allowed_function_names" are set, the predicted function calls will be limited to any one of "allowed_function_names", else the predicted function calls will be any one of the provided "function_declarations".
|
|
3752
3796
|
*/
|
|
3753
3797
|
VALIDATED = "VALIDATED"
|
|
3754
3798
|
}
|
|
3755
3799
|
|
|
3756
|
-
/**
|
|
3757
|
-
|
|
3758
|
-
The inputs are based on `OpenAPI 3.0 specifications
|
|
3759
|
-
<https://spec.openapis.org/oas/v3.0.3>`_. */
|
|
3800
|
+
/** Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client. */
|
|
3760
3801
|
export declare interface FunctionDeclaration {
|
|
3761
|
-
/** Defines the function behavior. */
|
|
3762
|
-
behavior?: Behavior;
|
|
3763
3802
|
/** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
|
|
3764
3803
|
description?: string;
|
|
3765
3804
|
/** Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64. */
|
|
@@ -3772,6 +3811,8 @@ export declare interface FunctionDeclaration {
|
|
|
3772
3811
|
response?: Schema;
|
|
3773
3812
|
/** Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`. */
|
|
3774
3813
|
responseJsonSchema?: unknown;
|
|
3814
|
+
/** Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This field is not supported in Vertex AI. */
|
|
3815
|
+
behavior?: Behavior;
|
|
3775
3816
|
}
|
|
3776
3817
|
|
|
3777
3818
|
/** A function response. */
|
|
@@ -4561,6 +4602,10 @@ export declare interface GenerationConfig {
|
|
|
4561
4602
|
* Configuration parameters for model interactions.
|
|
4562
4603
|
*/
|
|
4563
4604
|
declare interface GenerationConfig_2 {
|
|
4605
|
+
/**
|
|
4606
|
+
* Configuration for image interaction.
|
|
4607
|
+
*/
|
|
4608
|
+
image_config?: ImageConfig_2;
|
|
4564
4609
|
/**
|
|
4565
4610
|
* The maximum number of tokens to include in the response.
|
|
4566
4611
|
*/
|
|
@@ -5426,6 +5471,9 @@ export declare interface ImageConfig {
|
|
|
5426
5471
|
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
5427
5472
|
value `1K`. */
|
|
5428
5473
|
imageSize?: string;
|
|
5474
|
+
/** Controls the generation of people. Supported values are:
|
|
5475
|
+
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5476
|
+
personGeneration?: string;
|
|
5429
5477
|
/** MIME type of the generated image. This field is not
|
|
5430
5478
|
supported in Gemini API. */
|
|
5431
5479
|
outputMimeType?: string;
|
|
@@ -5434,11 +5482,22 @@ export declare interface ImageConfig {
|
|
|
5434
5482
|
outputCompressionQuality?: number;
|
|
5435
5483
|
}
|
|
5436
5484
|
|
|
5485
|
+
/**
|
|
5486
|
+
* The configuration for image interaction.
|
|
5487
|
+
*/
|
|
5488
|
+
declare interface ImageConfig_2 {
|
|
5489
|
+
aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '9:16' | '16:9' | '21:9';
|
|
5490
|
+
image_size?: '1K' | '2K' | '4K';
|
|
5491
|
+
}
|
|
5492
|
+
|
|
5437
5493
|
/**
|
|
5438
5494
|
* An image content block.
|
|
5439
5495
|
*/
|
|
5440
5496
|
declare interface ImageContent {
|
|
5441
5497
|
type: 'image';
|
|
5498
|
+
/**
|
|
5499
|
+
* The image content.
|
|
5500
|
+
*/
|
|
5442
5501
|
data?: string;
|
|
5443
5502
|
/**
|
|
5444
5503
|
* The mime type of the image.
|
|
@@ -5448,6 +5507,9 @@ declare interface ImageContent {
|
|
|
5448
5507
|
* The resolution of the media.
|
|
5449
5508
|
*/
|
|
5450
5509
|
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
5510
|
+
/**
|
|
5511
|
+
* The URI of the image.
|
|
5512
|
+
*/
|
|
5451
5513
|
uri?: string;
|
|
5452
5514
|
}
|
|
5453
5515
|
|
|
@@ -5610,14 +5672,10 @@ declare interface Interaction {
|
|
|
5610
5672
|
* The name of the `Model` used for generating the interaction.
|
|
5611
5673
|
*/
|
|
5612
5674
|
model?: Model_2;
|
|
5613
|
-
/**
|
|
5614
|
-
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5615
|
-
*/
|
|
5616
|
-
object?: 'interaction';
|
|
5617
5675
|
/**
|
|
5618
5676
|
* Output only. Responses from the model.
|
|
5619
5677
|
*/
|
|
5620
|
-
outputs?: Array<
|
|
5678
|
+
outputs?: Array<Content_2>;
|
|
5621
5679
|
/**
|
|
5622
5680
|
* The ID of the previous interaction, if any.
|
|
5623
5681
|
*/
|
|
@@ -5657,8 +5715,7 @@ declare type InteractionDeleteResponse = unknown;
|
|
|
5657
5715
|
|
|
5658
5716
|
declare interface InteractionEvent {
|
|
5659
5717
|
/**
|
|
5660
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5661
|
-
* this event.
|
|
5718
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5662
5719
|
*/
|
|
5663
5720
|
event_id?: string;
|
|
5664
5721
|
event_type?: 'interaction.start' | 'interaction.complete';
|
|
@@ -5708,7 +5765,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5708
5765
|
}
|
|
5709
5766
|
|
|
5710
5767
|
export declare namespace Interactions {
|
|
5711
|
-
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
|
|
5768
|
+
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type AudioMimeType as AudioMimeType, type CodeExecutionCallArguments as CodeExecutionCallArguments, type CodeExecutionCallContent as CodeExecutionCallContent, type CodeExecutionResultContent as CodeExecutionResultContent, type Content_2 as Content, type ContentDelta as ContentDelta, type ContentStart as ContentStart, type ContentStop as ContentStop, type DeepResearchAgentConfig as DeepResearchAgentConfig, type DocumentContent as DocumentContent, type DocumentMimeType as DocumentMimeType, type DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchCallContent as FileSearchCallContent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type ImageMimeType as ImageMimeType, type Interaction as Interaction, type InteractionEvent as InteractionEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStatusUpdate as InteractionStatusUpdate, type MCPServerToolCallContent as MCPServerToolCallContent, type MCPServerToolResultContent as MCPServerToolResultContent, type Model_2 as Model, type SpeechConfig_2 as SpeechConfig, type TextContent as TextContent, type ThinkingLevel_2 as ThinkingLevel, type ThoughtContent as ThoughtContent, type Tool_2 as Tool, type ToolChoice as ToolChoice, type ToolChoiceConfig as ToolChoiceConfig, type ToolChoiceType as ToolChoiceType, type Turn as Turn, type URLContextCallArguments as URLContextCallArguments, type URLContextCallContent as URLContextCallContent, type URLContextResult as URLContextResult, type URLContextResultContent as URLContextResultContent, type Usage as Usage, type VideoContent as VideoContent, type VideoMimeType as VideoMimeType, type InteractionDeleteResponse as InteractionDeleteResponse, type InteractionCreateParams as InteractionCreateParams, type CreateModelInteractionParamsNonStreaming as CreateModelInteractionParamsNonStreaming, type CreateModelInteractionParamsStreaming as CreateModelInteractionParamsStreaming, type CreateAgentInteractionParamsNonStreaming as CreateAgentInteractionParamsNonStreaming, type CreateAgentInteractionParamsStreaming as CreateAgentInteractionParamsStreaming, type InteractionDeleteParams as InteractionDeleteParams, type InteractionCancelParams as InteractionCancelParams, type InteractionGetParams as InteractionGetParams, type InteractionGetParamsNonStreaming as InteractionGetParamsNonStreaming, type InteractionGetParamsStreaming as InteractionGetParamsStreaming, };
|
|
5712
5769
|
}
|
|
5713
5770
|
|
|
5714
5771
|
declare namespace InteractionsAPI {
|
|
@@ -5722,6 +5779,7 @@ declare namespace InteractionsAPI {
|
|
|
5722
5779
|
CodeExecutionCallArguments,
|
|
5723
5780
|
CodeExecutionCallContent,
|
|
5724
5781
|
CodeExecutionResultContent,
|
|
5782
|
+
Content_2 as Content,
|
|
5725
5783
|
ContentDelta,
|
|
5726
5784
|
ContentStart,
|
|
5727
5785
|
ContentStop,
|
|
@@ -5730,6 +5788,7 @@ declare namespace InteractionsAPI {
|
|
|
5730
5788
|
DocumentMimeType,
|
|
5731
5789
|
DynamicAgentConfig,
|
|
5732
5790
|
ErrorEvent_2 as ErrorEvent,
|
|
5791
|
+
FileSearchCallContent,
|
|
5733
5792
|
FileSearchResultContent,
|
|
5734
5793
|
Function_2 as Function,
|
|
5735
5794
|
FunctionCallContent,
|
|
@@ -5739,6 +5798,7 @@ declare namespace InteractionsAPI {
|
|
|
5739
5798
|
GoogleSearchCallContent,
|
|
5740
5799
|
GoogleSearchResult,
|
|
5741
5800
|
GoogleSearchResultContent,
|
|
5801
|
+
ImageConfig_2 as ImageConfig,
|
|
5742
5802
|
ImageContent,
|
|
5743
5803
|
ImageMimeType,
|
|
5744
5804
|
Interaction,
|
|
@@ -5785,8 +5845,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
|
|
|
5785
5845
|
|
|
5786
5846
|
declare interface InteractionStatusUpdate {
|
|
5787
5847
|
/**
|
|
5788
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5789
|
-
* this event.
|
|
5848
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5790
5849
|
*/
|
|
5791
5850
|
event_id?: string;
|
|
5792
5851
|
event_type?: 'interaction.status_update';
|
|
@@ -6813,8 +6872,10 @@ export declare class LiveServerMessage {
|
|
|
6813
6872
|
goAway?: LiveServerGoAway;
|
|
6814
6873
|
/** Update of the session resumption state. */
|
|
6815
6874
|
sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
|
|
6816
|
-
/** Voice activity detection signal. */
|
|
6875
|
+
/** Voice activity detection signal. Allowlisted only. */
|
|
6817
6876
|
voiceActivityDetectionSignal?: VoiceActivityDetectionSignal;
|
|
6877
|
+
/** Voice activity signal. */
|
|
6878
|
+
voiceActivity?: VoiceActivity;
|
|
6818
6879
|
/**
|
|
6819
6880
|
* Returns the concatenation of all text parts from the server content if present.
|
|
6820
6881
|
*
|
|
@@ -7101,18 +7162,6 @@ export declare interface ModalityTokenCount {
|
|
|
7101
7162
|
tokenCount?: number;
|
|
7102
7163
|
}
|
|
7103
7164
|
|
|
7104
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
7105
|
-
export declare enum Mode {
|
|
7106
|
-
/**
|
|
7107
|
-
* Always trigger retrieval.
|
|
7108
|
-
*/
|
|
7109
|
-
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
7110
|
-
/**
|
|
7111
|
-
* Run retrieval only when system decides it is necessary.
|
|
7112
|
-
*/
|
|
7113
|
-
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
7114
|
-
}
|
|
7115
|
-
|
|
7116
7165
|
/** A trained machine learning model. */
|
|
7117
7166
|
export declare interface Model {
|
|
7118
7167
|
/** Resource name of the model. */
|
|
@@ -7171,7 +7220,7 @@ export declare interface Model {
|
|
|
7171
7220
|
/**
|
|
7172
7221
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7173
7222
|
*/
|
|
7174
|
-
declare type Model_2 = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-native-audio-dialog' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-pro-preview' | (string & {});
|
|
7223
|
+
declare type Model_2 = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-native-audio-dialog' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | (string & {});
|
|
7175
7224
|
|
|
7176
7225
|
export declare class Models extends BaseModule {
|
|
7177
7226
|
private readonly apiClient;
|
|
@@ -7283,7 +7332,7 @@ export declare class Models extends BaseModule {
|
|
|
7283
7332
|
* @example
|
|
7284
7333
|
* ```ts
|
|
7285
7334
|
* const response = await client.models.generateImages({
|
|
7286
|
-
* model: 'imagen-
|
|
7335
|
+
* model: 'imagen-4.0-generate-001',
|
|
7287
7336
|
* prompt: 'Robot holding a red skateboard',
|
|
7288
7337
|
* config: {
|
|
7289
7338
|
* numberOfImages: 1,
|
|
@@ -7326,7 +7375,7 @@ export declare class Models extends BaseModule {
|
|
|
7326
7375
|
* @example
|
|
7327
7376
|
* ```ts
|
|
7328
7377
|
* const response = await client.models.upscaleImage({
|
|
7329
|
-
* model: 'imagen-
|
|
7378
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
7330
7379
|
* image: image,
|
|
7331
7380
|
* upscaleFactor: 'x2',
|
|
7332
7381
|
* config: {
|
|
@@ -7425,7 +7474,7 @@ export declare class Models extends BaseModule {
|
|
|
7425
7474
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
7426
7475
|
*
|
|
7427
7476
|
* const response2 = await ai.models.recontextImage({
|
|
7428
|
-
* model: 'virtual-try-on-
|
|
7477
|
+
* model: 'virtual-try-on-001',
|
|
7429
7478
|
* source: {
|
|
7430
7479
|
* personImage: personImage,
|
|
7431
7480
|
* productImages: [productImage],
|
|
@@ -9280,12 +9329,8 @@ export declare interface TokensInfo {
|
|
|
9280
9329
|
|
|
9281
9330
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
9282
9331
|
export declare interface Tool {
|
|
9283
|
-
/** List of function declarations that the tool supports. */
|
|
9284
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
9285
9332
|
/** Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API. */
|
|
9286
9333
|
retrieval?: Retrieval;
|
|
9287
|
-
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9288
|
-
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9289
9334
|
/** Optional. Tool to support the model interacting directly with the
|
|
9290
9335
|
computer. If enabled, it automatically populates computer-use specific
|
|
9291
9336
|
Function Declarations. */
|
|
@@ -9296,10 +9341,14 @@ export declare interface Tool {
|
|
|
9296
9341
|
codeExecution?: ToolCodeExecution;
|
|
9297
9342
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
9298
9343
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
9344
|
+
/** Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided. */
|
|
9345
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
9299
9346
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9300
9347
|
googleMaps?: GoogleMaps;
|
|
9301
9348
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9302
9349
|
googleSearch?: GoogleSearch;
|
|
9350
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9351
|
+
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9303
9352
|
/** Optional. Tool to support URL context retrieval. */
|
|
9304
9353
|
urlContext?: UrlContext;
|
|
9305
9354
|
}
|
|
@@ -9409,10 +9458,10 @@ export declare interface ToolCodeExecution {
|
|
|
9409
9458
|
|
|
9410
9459
|
This config is shared for all tools provided in the request. */
|
|
9411
9460
|
export declare interface ToolConfig {
|
|
9412
|
-
/** Optional. Function calling config. */
|
|
9413
|
-
functionCallingConfig?: FunctionCallingConfig;
|
|
9414
9461
|
/** Optional. Retrieval config. */
|
|
9415
9462
|
retrievalConfig?: RetrievalConfig;
|
|
9463
|
+
/** Optional. Function calling config. */
|
|
9464
|
+
functionCallingConfig?: FunctionCallingConfig;
|
|
9416
9465
|
}
|
|
9417
9466
|
|
|
9418
9467
|
export declare type ToolListUnion = ToolUnion[];
|
|
@@ -9702,7 +9751,7 @@ declare interface Turn {
|
|
|
9702
9751
|
/**
|
|
9703
9752
|
* The content of the turn.
|
|
9704
9753
|
*/
|
|
9705
|
-
content?: string | Array<
|
|
9754
|
+
content?: string | Array<Content_2>;
|
|
9706
9755
|
/**
|
|
9707
9756
|
* The originator of this turn. Must be user for input or model for
|
|
9708
9757
|
* model output.
|
|
@@ -9799,11 +9848,13 @@ declare namespace types {
|
|
|
9799
9848
|
Language,
|
|
9800
9849
|
FunctionResponseScheduling,
|
|
9801
9850
|
Type,
|
|
9802
|
-
Mode,
|
|
9803
9851
|
ApiSpec,
|
|
9804
9852
|
AuthType,
|
|
9805
9853
|
HttpElementLocation,
|
|
9806
9854
|
PhishBlockThreshold,
|
|
9855
|
+
Behavior,
|
|
9856
|
+
DynamicRetrievalConfigMode,
|
|
9857
|
+
FunctionCallingConfigMode,
|
|
9807
9858
|
ThinkingLevel,
|
|
9808
9859
|
HarmCategory,
|
|
9809
9860
|
HarmBlockMethod,
|
|
@@ -9822,10 +9873,7 @@ declare namespace types {
|
|
|
9822
9873
|
TuningTask,
|
|
9823
9874
|
PartMediaResolutionLevel,
|
|
9824
9875
|
FeatureSelectionPreference,
|
|
9825
|
-
Behavior,
|
|
9826
|
-
DynamicRetrievalConfigMode,
|
|
9827
9876
|
Environment,
|
|
9828
|
-
FunctionCallingConfigMode,
|
|
9829
9877
|
SafetyFilterLevel,
|
|
9830
9878
|
PersonGeneration,
|
|
9831
9879
|
ImagePromptLanguage,
|
|
@@ -9844,6 +9892,7 @@ declare namespace types {
|
|
|
9844
9892
|
TurnCompleteReason,
|
|
9845
9893
|
MediaModality,
|
|
9846
9894
|
VadSignalType,
|
|
9895
|
+
VoiceActivityType,
|
|
9847
9896
|
StartSensitivity,
|
|
9848
9897
|
EndSensitivity,
|
|
9849
9898
|
ActivityHandling,
|
|
@@ -9868,9 +9917,6 @@ declare namespace types {
|
|
|
9868
9917
|
HttpOptions,
|
|
9869
9918
|
Schema,
|
|
9870
9919
|
ModelSelectionConfig,
|
|
9871
|
-
FunctionDeclaration,
|
|
9872
|
-
DynamicRetrievalConfig,
|
|
9873
|
-
GoogleSearchRetrieval,
|
|
9874
9920
|
ComputerUse,
|
|
9875
9921
|
FileSearch,
|
|
9876
9922
|
ApiAuthApiKeyConfig,
|
|
@@ -9897,14 +9943,17 @@ declare namespace types {
|
|
|
9897
9943
|
Retrieval,
|
|
9898
9944
|
ToolCodeExecution,
|
|
9899
9945
|
EnterpriseWebSearch,
|
|
9946
|
+
FunctionDeclaration,
|
|
9900
9947
|
GoogleMaps,
|
|
9901
9948
|
Interval,
|
|
9902
9949
|
GoogleSearch,
|
|
9950
|
+
DynamicRetrievalConfig,
|
|
9951
|
+
GoogleSearchRetrieval,
|
|
9903
9952
|
UrlContext,
|
|
9904
9953
|
Tool,
|
|
9905
|
-
FunctionCallingConfig,
|
|
9906
9954
|
LatLng,
|
|
9907
9955
|
RetrievalConfig,
|
|
9956
|
+
FunctionCallingConfig,
|
|
9908
9957
|
ToolConfig,
|
|
9909
9958
|
ReplicatedVoiceConfig,
|
|
9910
9959
|
PrebuiltVoiceConfig,
|
|
@@ -10166,6 +10215,7 @@ declare namespace types {
|
|
|
10166
10215
|
LiveServerGoAway,
|
|
10167
10216
|
LiveServerSessionResumptionUpdate,
|
|
10168
10217
|
VoiceActivityDetectionSignal,
|
|
10218
|
+
VoiceActivity,
|
|
10169
10219
|
LiveServerMessage,
|
|
10170
10220
|
OperationFromAPIResponseParameters,
|
|
10171
10221
|
GenerationConfigThinkingConfig,
|
|
@@ -10213,6 +10263,8 @@ declare namespace types {
|
|
|
10213
10263
|
CreateAuthTokenConfig,
|
|
10214
10264
|
CreateAuthTokenParameters,
|
|
10215
10265
|
OperationGetParameters,
|
|
10266
|
+
CountTokensResult,
|
|
10267
|
+
ComputeTokensResult,
|
|
10216
10268
|
CreateTuningJobParameters,
|
|
10217
10269
|
UploadToFileSearchStoreResponse,
|
|
10218
10270
|
UploadToFileSearchStoreOperation,
|
|
@@ -10647,7 +10699,7 @@ declare interface Usage {
|
|
|
10647
10699
|
/**
|
|
10648
10700
|
* Number of tokens of thoughts for thinking models.
|
|
10649
10701
|
*/
|
|
10650
|
-
|
|
10702
|
+
total_thought_tokens?: number;
|
|
10651
10703
|
/**
|
|
10652
10704
|
* Total token count for the interaction request (prompt + responses + other
|
|
10653
10705
|
* internal tokens).
|
|
@@ -10853,6 +10905,9 @@ export declare enum VideoCompressionQuality {
|
|
|
10853
10905
|
*/
|
|
10854
10906
|
declare interface VideoContent {
|
|
10855
10907
|
type: 'video';
|
|
10908
|
+
/**
|
|
10909
|
+
* The video content.
|
|
10910
|
+
*/
|
|
10856
10911
|
data?: string;
|
|
10857
10912
|
/**
|
|
10858
10913
|
* The mime type of the video.
|
|
@@ -10862,6 +10917,9 @@ declare interface VideoContent {
|
|
|
10862
10917
|
* The resolution of the media.
|
|
10863
10918
|
*/
|
|
10864
10919
|
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
10920
|
+
/**
|
|
10921
|
+
* The URI of the video.
|
|
10922
|
+
*/
|
|
10865
10923
|
uri?: string;
|
|
10866
10924
|
}
|
|
10867
10925
|
|
|
@@ -10941,11 +10999,33 @@ export declare interface VideoMetadata {
|
|
|
10941
10999
|
*/
|
|
10942
11000
|
declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
|
|
10943
11001
|
|
|
11002
|
+
/** Voice activity signal. */
|
|
11003
|
+
export declare interface VoiceActivity {
|
|
11004
|
+
/** The type of the voice activity signal. */
|
|
11005
|
+
voiceActivityType?: VoiceActivityType;
|
|
11006
|
+
}
|
|
11007
|
+
|
|
10944
11008
|
export declare interface VoiceActivityDetectionSignal {
|
|
10945
11009
|
/** The type of the VAD signal. */
|
|
10946
11010
|
vadSignalType?: VadSignalType;
|
|
10947
11011
|
}
|
|
10948
11012
|
|
|
11013
|
+
/** The type of the voice activity signal. */
|
|
11014
|
+
export declare enum VoiceActivityType {
|
|
11015
|
+
/**
|
|
11016
|
+
* The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
|
|
11017
|
+
*/
|
|
11018
|
+
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
11019
|
+
/**
|
|
11020
|
+
* Start of sentence signal.
|
|
11021
|
+
*/
|
|
11022
|
+
ACTIVITY_START = "ACTIVITY_START",
|
|
11023
|
+
/**
|
|
11024
|
+
* End of sentence signal.
|
|
11025
|
+
*/
|
|
11026
|
+
ACTIVITY_END = "ACTIVITY_END"
|
|
11027
|
+
}
|
|
11028
|
+
|
|
10949
11029
|
export declare interface VoiceConfig {
|
|
10950
11030
|
/** If true, the model will use a replicated voice for the response. */
|
|
10951
11031
|
replicatedVoiceConfig?: ReplicatedVoiceConfig;
|