@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/node/node.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
|
*/
|
|
@@ -5433,6 +5478,9 @@ export declare interface ImageConfig {
|
|
|
5433
5478
|
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
5434
5479
|
value `1K`. */
|
|
5435
5480
|
imageSize?: string;
|
|
5481
|
+
/** Controls the generation of people. Supported values are:
|
|
5482
|
+
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5483
|
+
personGeneration?: string;
|
|
5436
5484
|
/** MIME type of the generated image. This field is not
|
|
5437
5485
|
supported in Gemini API. */
|
|
5438
5486
|
outputMimeType?: string;
|
|
@@ -5441,11 +5489,22 @@ export declare interface ImageConfig {
|
|
|
5441
5489
|
outputCompressionQuality?: number;
|
|
5442
5490
|
}
|
|
5443
5491
|
|
|
5492
|
+
/**
|
|
5493
|
+
* The configuration for image interaction.
|
|
5494
|
+
*/
|
|
5495
|
+
declare interface ImageConfig_2 {
|
|
5496
|
+
aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '9:16' | '16:9' | '21:9';
|
|
5497
|
+
image_size?: '1K' | '2K' | '4K';
|
|
5498
|
+
}
|
|
5499
|
+
|
|
5444
5500
|
/**
|
|
5445
5501
|
* An image content block.
|
|
5446
5502
|
*/
|
|
5447
5503
|
declare interface ImageContent {
|
|
5448
5504
|
type: 'image';
|
|
5505
|
+
/**
|
|
5506
|
+
* The image content.
|
|
5507
|
+
*/
|
|
5449
5508
|
data?: string;
|
|
5450
5509
|
/**
|
|
5451
5510
|
* The mime type of the image.
|
|
@@ -5455,6 +5514,9 @@ declare interface ImageContent {
|
|
|
5455
5514
|
* The resolution of the media.
|
|
5456
5515
|
*/
|
|
5457
5516
|
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
5517
|
+
/**
|
|
5518
|
+
* The URI of the image.
|
|
5519
|
+
*/
|
|
5458
5520
|
uri?: string;
|
|
5459
5521
|
}
|
|
5460
5522
|
|
|
@@ -5617,14 +5679,10 @@ declare interface Interaction {
|
|
|
5617
5679
|
* The name of the `Model` used for generating the interaction.
|
|
5618
5680
|
*/
|
|
5619
5681
|
model?: Model_2;
|
|
5620
|
-
/**
|
|
5621
|
-
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5622
|
-
*/
|
|
5623
|
-
object?: 'interaction';
|
|
5624
5682
|
/**
|
|
5625
5683
|
* Output only. Responses from the model.
|
|
5626
5684
|
*/
|
|
5627
|
-
outputs?: Array<
|
|
5685
|
+
outputs?: Array<Content_2>;
|
|
5628
5686
|
/**
|
|
5629
5687
|
* The ID of the previous interaction, if any.
|
|
5630
5688
|
*/
|
|
@@ -5664,8 +5722,7 @@ declare type InteractionDeleteResponse = unknown;
|
|
|
5664
5722
|
|
|
5665
5723
|
declare interface InteractionEvent {
|
|
5666
5724
|
/**
|
|
5667
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5668
|
-
* this event.
|
|
5725
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5669
5726
|
*/
|
|
5670
5727
|
event_id?: string;
|
|
5671
5728
|
event_type?: 'interaction.start' | 'interaction.complete';
|
|
@@ -5715,7 +5772,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5715
5772
|
}
|
|
5716
5773
|
|
|
5717
5774
|
export declare namespace Interactions {
|
|
5718
|
-
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, };
|
|
5775
|
+
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, };
|
|
5719
5776
|
}
|
|
5720
5777
|
|
|
5721
5778
|
declare namespace InteractionsAPI {
|
|
@@ -5729,6 +5786,7 @@ declare namespace InteractionsAPI {
|
|
|
5729
5786
|
CodeExecutionCallArguments,
|
|
5730
5787
|
CodeExecutionCallContent,
|
|
5731
5788
|
CodeExecutionResultContent,
|
|
5789
|
+
Content_2 as Content,
|
|
5732
5790
|
ContentDelta,
|
|
5733
5791
|
ContentStart,
|
|
5734
5792
|
ContentStop,
|
|
@@ -5737,6 +5795,7 @@ declare namespace InteractionsAPI {
|
|
|
5737
5795
|
DocumentMimeType,
|
|
5738
5796
|
DynamicAgentConfig,
|
|
5739
5797
|
ErrorEvent_2 as ErrorEvent,
|
|
5798
|
+
FileSearchCallContent,
|
|
5740
5799
|
FileSearchResultContent,
|
|
5741
5800
|
Function_2 as Function,
|
|
5742
5801
|
FunctionCallContent,
|
|
@@ -5746,6 +5805,7 @@ declare namespace InteractionsAPI {
|
|
|
5746
5805
|
GoogleSearchCallContent,
|
|
5747
5806
|
GoogleSearchResult,
|
|
5748
5807
|
GoogleSearchResultContent,
|
|
5808
|
+
ImageConfig_2 as ImageConfig,
|
|
5749
5809
|
ImageContent,
|
|
5750
5810
|
ImageMimeType,
|
|
5751
5811
|
Interaction,
|
|
@@ -5792,8 +5852,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
|
|
|
5792
5852
|
|
|
5793
5853
|
declare interface InteractionStatusUpdate {
|
|
5794
5854
|
/**
|
|
5795
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5796
|
-
* this event.
|
|
5855
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5797
5856
|
*/
|
|
5798
5857
|
event_id?: string;
|
|
5799
5858
|
event_type?: 'interaction.status_update';
|
|
@@ -6820,8 +6879,10 @@ export declare class LiveServerMessage {
|
|
|
6820
6879
|
goAway?: LiveServerGoAway;
|
|
6821
6880
|
/** Update of the session resumption state. */
|
|
6822
6881
|
sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
|
|
6823
|
-
/** Voice activity detection signal. */
|
|
6882
|
+
/** Voice activity detection signal. Allowlisted only. */
|
|
6824
6883
|
voiceActivityDetectionSignal?: VoiceActivityDetectionSignal;
|
|
6884
|
+
/** Voice activity signal. */
|
|
6885
|
+
voiceActivity?: VoiceActivity;
|
|
6825
6886
|
/**
|
|
6826
6887
|
* Returns the concatenation of all text parts from the server content if present.
|
|
6827
6888
|
*
|
|
@@ -7108,18 +7169,6 @@ export declare interface ModalityTokenCount {
|
|
|
7108
7169
|
tokenCount?: number;
|
|
7109
7170
|
}
|
|
7110
7171
|
|
|
7111
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
7112
|
-
export declare enum Mode {
|
|
7113
|
-
/**
|
|
7114
|
-
* Always trigger retrieval.
|
|
7115
|
-
*/
|
|
7116
|
-
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
7117
|
-
/**
|
|
7118
|
-
* Run retrieval only when system decides it is necessary.
|
|
7119
|
-
*/
|
|
7120
|
-
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
7121
|
-
}
|
|
7122
|
-
|
|
7123
7172
|
/** A trained machine learning model. */
|
|
7124
7173
|
export declare interface Model {
|
|
7125
7174
|
/** Resource name of the model. */
|
|
@@ -7178,7 +7227,7 @@ export declare interface Model {
|
|
|
7178
7227
|
/**
|
|
7179
7228
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7180
7229
|
*/
|
|
7181
|
-
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 & {});
|
|
7230
|
+
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 & {});
|
|
7182
7231
|
|
|
7183
7232
|
export declare class Models extends BaseModule {
|
|
7184
7233
|
private readonly apiClient;
|
|
@@ -7290,7 +7339,7 @@ export declare class Models extends BaseModule {
|
|
|
7290
7339
|
* @example
|
|
7291
7340
|
* ```ts
|
|
7292
7341
|
* const response = await client.models.generateImages({
|
|
7293
|
-
* model: 'imagen-
|
|
7342
|
+
* model: 'imagen-4.0-generate-001',
|
|
7294
7343
|
* prompt: 'Robot holding a red skateboard',
|
|
7295
7344
|
* config: {
|
|
7296
7345
|
* numberOfImages: 1,
|
|
@@ -7333,7 +7382,7 @@ export declare class Models extends BaseModule {
|
|
|
7333
7382
|
* @example
|
|
7334
7383
|
* ```ts
|
|
7335
7384
|
* const response = await client.models.upscaleImage({
|
|
7336
|
-
* model: 'imagen-
|
|
7385
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
7337
7386
|
* image: image,
|
|
7338
7387
|
* upscaleFactor: 'x2',
|
|
7339
7388
|
* config: {
|
|
@@ -7432,7 +7481,7 @@ export declare class Models extends BaseModule {
|
|
|
7432
7481
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
7433
7482
|
*
|
|
7434
7483
|
* const response2 = await ai.models.recontextImage({
|
|
7435
|
-
* model: 'virtual-try-on-
|
|
7484
|
+
* model: 'virtual-try-on-001',
|
|
7436
7485
|
* source: {
|
|
7437
7486
|
* personImage: personImage,
|
|
7438
7487
|
* productImages: [productImage],
|
|
@@ -9287,12 +9336,8 @@ export declare interface TokensInfo {
|
|
|
9287
9336
|
|
|
9288
9337
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
9289
9338
|
export declare interface Tool {
|
|
9290
|
-
/** List of function declarations that the tool supports. */
|
|
9291
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
9292
9339
|
/** 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. */
|
|
9293
9340
|
retrieval?: Retrieval;
|
|
9294
|
-
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9295
|
-
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9296
9341
|
/** Optional. Tool to support the model interacting directly with the
|
|
9297
9342
|
computer. If enabled, it automatically populates computer-use specific
|
|
9298
9343
|
Function Declarations. */
|
|
@@ -9303,10 +9348,14 @@ export declare interface Tool {
|
|
|
9303
9348
|
codeExecution?: ToolCodeExecution;
|
|
9304
9349
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
9305
9350
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
9351
|
+
/** 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. */
|
|
9352
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
9306
9353
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9307
9354
|
googleMaps?: GoogleMaps;
|
|
9308
9355
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9309
9356
|
googleSearch?: GoogleSearch;
|
|
9357
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9358
|
+
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9310
9359
|
/** Optional. Tool to support URL context retrieval. */
|
|
9311
9360
|
urlContext?: UrlContext;
|
|
9312
9361
|
}
|
|
@@ -9416,10 +9465,10 @@ export declare interface ToolCodeExecution {
|
|
|
9416
9465
|
|
|
9417
9466
|
This config is shared for all tools provided in the request. */
|
|
9418
9467
|
export declare interface ToolConfig {
|
|
9419
|
-
/** Optional. Function calling config. */
|
|
9420
|
-
functionCallingConfig?: FunctionCallingConfig;
|
|
9421
9468
|
/** Optional. Retrieval config. */
|
|
9422
9469
|
retrievalConfig?: RetrievalConfig;
|
|
9470
|
+
/** Optional. Function calling config. */
|
|
9471
|
+
functionCallingConfig?: FunctionCallingConfig;
|
|
9423
9472
|
}
|
|
9424
9473
|
|
|
9425
9474
|
export declare type ToolListUnion = ToolUnion[];
|
|
@@ -9709,7 +9758,7 @@ declare interface Turn {
|
|
|
9709
9758
|
/**
|
|
9710
9759
|
* The content of the turn.
|
|
9711
9760
|
*/
|
|
9712
|
-
content?: string | Array<
|
|
9761
|
+
content?: string | Array<Content_2>;
|
|
9713
9762
|
/**
|
|
9714
9763
|
* The originator of this turn. Must be user for input or model for
|
|
9715
9764
|
* model output.
|
|
@@ -9806,11 +9855,13 @@ declare namespace types {
|
|
|
9806
9855
|
Language,
|
|
9807
9856
|
FunctionResponseScheduling,
|
|
9808
9857
|
Type,
|
|
9809
|
-
Mode,
|
|
9810
9858
|
ApiSpec,
|
|
9811
9859
|
AuthType,
|
|
9812
9860
|
HttpElementLocation,
|
|
9813
9861
|
PhishBlockThreshold,
|
|
9862
|
+
Behavior,
|
|
9863
|
+
DynamicRetrievalConfigMode,
|
|
9864
|
+
FunctionCallingConfigMode,
|
|
9814
9865
|
ThinkingLevel,
|
|
9815
9866
|
HarmCategory,
|
|
9816
9867
|
HarmBlockMethod,
|
|
@@ -9829,10 +9880,7 @@ declare namespace types {
|
|
|
9829
9880
|
TuningTask,
|
|
9830
9881
|
PartMediaResolutionLevel,
|
|
9831
9882
|
FeatureSelectionPreference,
|
|
9832
|
-
Behavior,
|
|
9833
|
-
DynamicRetrievalConfigMode,
|
|
9834
9883
|
Environment,
|
|
9835
|
-
FunctionCallingConfigMode,
|
|
9836
9884
|
SafetyFilterLevel,
|
|
9837
9885
|
PersonGeneration,
|
|
9838
9886
|
ImagePromptLanguage,
|
|
@@ -9851,6 +9899,7 @@ declare namespace types {
|
|
|
9851
9899
|
TurnCompleteReason,
|
|
9852
9900
|
MediaModality,
|
|
9853
9901
|
VadSignalType,
|
|
9902
|
+
VoiceActivityType,
|
|
9854
9903
|
StartSensitivity,
|
|
9855
9904
|
EndSensitivity,
|
|
9856
9905
|
ActivityHandling,
|
|
@@ -9875,9 +9924,6 @@ declare namespace types {
|
|
|
9875
9924
|
HttpOptions,
|
|
9876
9925
|
Schema,
|
|
9877
9926
|
ModelSelectionConfig,
|
|
9878
|
-
FunctionDeclaration,
|
|
9879
|
-
DynamicRetrievalConfig,
|
|
9880
|
-
GoogleSearchRetrieval,
|
|
9881
9927
|
ComputerUse,
|
|
9882
9928
|
FileSearch,
|
|
9883
9929
|
ApiAuthApiKeyConfig,
|
|
@@ -9904,14 +9950,17 @@ declare namespace types {
|
|
|
9904
9950
|
Retrieval,
|
|
9905
9951
|
ToolCodeExecution,
|
|
9906
9952
|
EnterpriseWebSearch,
|
|
9953
|
+
FunctionDeclaration,
|
|
9907
9954
|
GoogleMaps,
|
|
9908
9955
|
Interval,
|
|
9909
9956
|
GoogleSearch,
|
|
9957
|
+
DynamicRetrievalConfig,
|
|
9958
|
+
GoogleSearchRetrieval,
|
|
9910
9959
|
UrlContext,
|
|
9911
9960
|
Tool,
|
|
9912
|
-
FunctionCallingConfig,
|
|
9913
9961
|
LatLng,
|
|
9914
9962
|
RetrievalConfig,
|
|
9963
|
+
FunctionCallingConfig,
|
|
9915
9964
|
ToolConfig,
|
|
9916
9965
|
ReplicatedVoiceConfig,
|
|
9917
9966
|
PrebuiltVoiceConfig,
|
|
@@ -10173,6 +10222,7 @@ declare namespace types {
|
|
|
10173
10222
|
LiveServerGoAway,
|
|
10174
10223
|
LiveServerSessionResumptionUpdate,
|
|
10175
10224
|
VoiceActivityDetectionSignal,
|
|
10225
|
+
VoiceActivity,
|
|
10176
10226
|
LiveServerMessage,
|
|
10177
10227
|
OperationFromAPIResponseParameters,
|
|
10178
10228
|
GenerationConfigThinkingConfig,
|
|
@@ -10220,6 +10270,8 @@ declare namespace types {
|
|
|
10220
10270
|
CreateAuthTokenConfig,
|
|
10221
10271
|
CreateAuthTokenParameters,
|
|
10222
10272
|
OperationGetParameters,
|
|
10273
|
+
CountTokensResult,
|
|
10274
|
+
ComputeTokensResult,
|
|
10223
10275
|
CreateTuningJobParameters,
|
|
10224
10276
|
UploadToFileSearchStoreResponse,
|
|
10225
10277
|
UploadToFileSearchStoreOperation,
|
|
@@ -10654,7 +10706,7 @@ declare interface Usage {
|
|
|
10654
10706
|
/**
|
|
10655
10707
|
* Number of tokens of thoughts for thinking models.
|
|
10656
10708
|
*/
|
|
10657
|
-
|
|
10709
|
+
total_thought_tokens?: number;
|
|
10658
10710
|
/**
|
|
10659
10711
|
* Total token count for the interaction request (prompt + responses + other
|
|
10660
10712
|
* internal tokens).
|
|
@@ -10860,6 +10912,9 @@ export declare enum VideoCompressionQuality {
|
|
|
10860
10912
|
*/
|
|
10861
10913
|
declare interface VideoContent {
|
|
10862
10914
|
type: 'video';
|
|
10915
|
+
/**
|
|
10916
|
+
* The video content.
|
|
10917
|
+
*/
|
|
10863
10918
|
data?: string;
|
|
10864
10919
|
/**
|
|
10865
10920
|
* The mime type of the video.
|
|
@@ -10869,6 +10924,9 @@ declare interface VideoContent {
|
|
|
10869
10924
|
* The resolution of the media.
|
|
10870
10925
|
*/
|
|
10871
10926
|
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
10927
|
+
/**
|
|
10928
|
+
* The URI of the video.
|
|
10929
|
+
*/
|
|
10872
10930
|
uri?: string;
|
|
10873
10931
|
}
|
|
10874
10932
|
|
|
@@ -10948,11 +11006,33 @@ export declare interface VideoMetadata {
|
|
|
10948
11006
|
*/
|
|
10949
11007
|
declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
|
|
10950
11008
|
|
|
11009
|
+
/** Voice activity signal. */
|
|
11010
|
+
export declare interface VoiceActivity {
|
|
11011
|
+
/** The type of the voice activity signal. */
|
|
11012
|
+
voiceActivityType?: VoiceActivityType;
|
|
11013
|
+
}
|
|
11014
|
+
|
|
10951
11015
|
export declare interface VoiceActivityDetectionSignal {
|
|
10952
11016
|
/** The type of the VAD signal. */
|
|
10953
11017
|
vadSignalType?: VadSignalType;
|
|
10954
11018
|
}
|
|
10955
11019
|
|
|
11020
|
+
/** The type of the voice activity signal. */
|
|
11021
|
+
export declare enum VoiceActivityType {
|
|
11022
|
+
/**
|
|
11023
|
+
* The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
|
|
11024
|
+
*/
|
|
11025
|
+
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
11026
|
+
/**
|
|
11027
|
+
* Start of sentence signal.
|
|
11028
|
+
*/
|
|
11029
|
+
ACTIVITY_START = "ACTIVITY_START",
|
|
11030
|
+
/**
|
|
11031
|
+
* End of sentence signal.
|
|
11032
|
+
*/
|
|
11033
|
+
ACTIVITY_END = "ACTIVITY_END"
|
|
11034
|
+
}
|
|
11035
|
+
|
|
10956
11036
|
export declare interface VoiceConfig {
|
|
10957
11037
|
/** If true, the model will use a replicated voice for the response. */
|
|
10958
11038
|
replicatedVoiceConfig?: ReplicatedVoiceConfig;
|