@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 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<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
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<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
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
- /** Defines the function behavior. Defaults to `BLOCKING`. */
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?: TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
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
- /** Config for the dynamic retrieval config mode. */
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
- /** Config for the function calling config mode. */
3776
+ /** Function calling mode. */
3733
3777
  export declare enum FunctionCallingConfigMode {
3734
3778
  /**
3735
- * The function calling config mode is unspecified. Should not be used.
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 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".
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
- /** Defines a function that the model can generate JSON inputs for.
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
  */
@@ -5421,6 +5466,9 @@ export declare interface ImageConfig {
5421
5466
  values are `1K`, `2K`, `4K`. If not specified, the model will use default
5422
5467
  value `1K`. */
5423
5468
  imageSize?: string;
5469
+ /** Controls the generation of people. Supported values are:
5470
+ ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
5471
+ personGeneration?: string;
5424
5472
  /** MIME type of the generated image. This field is not
5425
5473
  supported in Gemini API. */
5426
5474
  outputMimeType?: string;
@@ -5429,11 +5477,22 @@ export declare interface ImageConfig {
5429
5477
  outputCompressionQuality?: number;
5430
5478
  }
5431
5479
 
5480
+ /**
5481
+ * The configuration for image interaction.
5482
+ */
5483
+ declare interface ImageConfig_2 {
5484
+ aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '9:16' | '16:9' | '21:9';
5485
+ image_size?: '1K' | '2K' | '4K';
5486
+ }
5487
+
5432
5488
  /**
5433
5489
  * An image content block.
5434
5490
  */
5435
5491
  declare interface ImageContent {
5436
5492
  type: 'image';
5493
+ /**
5494
+ * The image content.
5495
+ */
5437
5496
  data?: string;
5438
5497
  /**
5439
5498
  * The mime type of the image.
@@ -5443,6 +5502,9 @@ declare interface ImageContent {
5443
5502
  * The resolution of the media.
5444
5503
  */
5445
5504
  resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
5505
+ /**
5506
+ * The URI of the image.
5507
+ */
5446
5508
  uri?: string;
5447
5509
  }
5448
5510
 
@@ -5605,14 +5667,10 @@ declare interface Interaction {
5605
5667
  * The name of the `Model` used for generating the interaction.
5606
5668
  */
5607
5669
  model?: Model_2;
5608
- /**
5609
- * Output only. The object type of the interaction. Always set to `interaction`.
5610
- */
5611
- object?: 'interaction';
5612
5670
  /**
5613
5671
  * Output only. Responses from the model.
5614
5672
  */
5615
- outputs?: Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
5673
+ outputs?: Array<Content_2>;
5616
5674
  /**
5617
5675
  * The ID of the previous interaction, if any.
5618
5676
  */
@@ -5652,8 +5710,7 @@ declare type InteractionDeleteResponse = unknown;
5652
5710
 
5653
5711
  declare interface InteractionEvent {
5654
5712
  /**
5655
- * The event_id token to be used to resume the interaction stream, from
5656
- * this event.
5713
+ * The event_id token to be used to resume the interaction stream, from this event.
5657
5714
  */
5658
5715
  event_id?: string;
5659
5716
  event_type?: 'interaction.start' | 'interaction.complete';
@@ -5703,7 +5760,7 @@ export declare class Interactions extends BaseInteractions {
5703
5760
  }
5704
5761
 
5705
5762
  export declare namespace Interactions {
5706
- 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, };
5763
+ 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, };
5707
5764
  }
5708
5765
 
5709
5766
  declare namespace InteractionsAPI {
@@ -5717,6 +5774,7 @@ declare namespace InteractionsAPI {
5717
5774
  CodeExecutionCallArguments,
5718
5775
  CodeExecutionCallContent,
5719
5776
  CodeExecutionResultContent,
5777
+ Content_2 as Content,
5720
5778
  ContentDelta,
5721
5779
  ContentStart,
5722
5780
  ContentStop,
@@ -5725,6 +5783,7 @@ declare namespace InteractionsAPI {
5725
5783
  DocumentMimeType,
5726
5784
  DynamicAgentConfig,
5727
5785
  ErrorEvent_2 as ErrorEvent,
5786
+ FileSearchCallContent,
5728
5787
  FileSearchResultContent,
5729
5788
  Function_2 as Function,
5730
5789
  FunctionCallContent,
@@ -5734,6 +5793,7 @@ declare namespace InteractionsAPI {
5734
5793
  GoogleSearchCallContent,
5735
5794
  GoogleSearchResult,
5736
5795
  GoogleSearchResultContent,
5796
+ ImageConfig_2 as ImageConfig,
5737
5797
  ImageContent,
5738
5798
  ImageMimeType,
5739
5799
  Interaction,
@@ -5780,8 +5840,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
5780
5840
 
5781
5841
  declare interface InteractionStatusUpdate {
5782
5842
  /**
5783
- * The event_id token to be used to resume the interaction stream, from
5784
- * this event.
5843
+ * The event_id token to be used to resume the interaction stream, from this event.
5785
5844
  */
5786
5845
  event_id?: string;
5787
5846
  event_type?: 'interaction.status_update';
@@ -6808,8 +6867,10 @@ export declare class LiveServerMessage {
6808
6867
  goAway?: LiveServerGoAway;
6809
6868
  /** Update of the session resumption state. */
6810
6869
  sessionResumptionUpdate?: LiveServerSessionResumptionUpdate;
6811
- /** Voice activity detection signal. */
6870
+ /** Voice activity detection signal. Allowlisted only. */
6812
6871
  voiceActivityDetectionSignal?: VoiceActivityDetectionSignal;
6872
+ /** Voice activity signal. */
6873
+ voiceActivity?: VoiceActivity;
6813
6874
  /**
6814
6875
  * Returns the concatenation of all text parts from the server content if present.
6815
6876
  *
@@ -7096,18 +7157,6 @@ export declare interface ModalityTokenCount {
7096
7157
  tokenCount?: number;
7097
7158
  }
7098
7159
 
7099
- /** The mode of the predictor to be used in dynamic retrieval. */
7100
- export declare enum Mode {
7101
- /**
7102
- * Always trigger retrieval.
7103
- */
7104
- MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
7105
- /**
7106
- * Run retrieval only when system decides it is necessary.
7107
- */
7108
- MODE_DYNAMIC = "MODE_DYNAMIC"
7109
- }
7110
-
7111
7160
  /** A trained machine learning model. */
7112
7161
  export declare interface Model {
7113
7162
  /** Resource name of the model. */
@@ -7166,7 +7215,7 @@ export declare interface Model {
7166
7215
  /**
7167
7216
  * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
7168
7217
  */
7169
- 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 & {});
7218
+ 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 & {});
7170
7219
 
7171
7220
  export declare class Models extends BaseModule {
7172
7221
  private readonly apiClient;
@@ -7278,7 +7327,7 @@ export declare class Models extends BaseModule {
7278
7327
  * @example
7279
7328
  * ```ts
7280
7329
  * const response = await client.models.generateImages({
7281
- * model: 'imagen-3.0-generate-002',
7330
+ * model: 'imagen-4.0-generate-001',
7282
7331
  * prompt: 'Robot holding a red skateboard',
7283
7332
  * config: {
7284
7333
  * numberOfImages: 1,
@@ -7321,7 +7370,7 @@ export declare class Models extends BaseModule {
7321
7370
  * @example
7322
7371
  * ```ts
7323
7372
  * const response = await client.models.upscaleImage({
7324
- * model: 'imagen-3.0-generate-002',
7373
+ * model: 'imagen-4.0-upscale-preview',
7325
7374
  * image: image,
7326
7375
  * upscaleFactor: 'x2',
7327
7376
  * config: {
@@ -7420,7 +7469,7 @@ export declare class Models extends BaseModule {
7420
7469
  * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
7421
7470
  *
7422
7471
  * const response2 = await ai.models.recontextImage({
7423
- * model: 'virtual-try-on-preview-08-04',
7472
+ * model: 'virtual-try-on-001',
7424
7473
  * source: {
7425
7474
  * personImage: personImage,
7426
7475
  * productImages: [productImage],
@@ -9275,12 +9324,8 @@ export declare interface TokensInfo {
9275
9324
 
9276
9325
  /** Tool details of a tool that the model may use to generate a response. */
9277
9326
  export declare interface Tool {
9278
- /** List of function declarations that the tool supports. */
9279
- functionDeclarations?: FunctionDeclaration[];
9280
9327
  /** 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. */
9281
9328
  retrieval?: Retrieval;
9282
- /** Optional. Specialized retrieval tool that is powered by Google Search. */
9283
- googleSearchRetrieval?: GoogleSearchRetrieval;
9284
9329
  /** Optional. Tool to support the model interacting directly with the
9285
9330
  computer. If enabled, it automatically populates computer-use specific
9286
9331
  Function Declarations. */
@@ -9291,10 +9336,14 @@ export declare interface Tool {
9291
9336
  codeExecution?: ToolCodeExecution;
9292
9337
  /** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
9293
9338
  enterpriseWebSearch?: EnterpriseWebSearch;
9339
+ /** 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. */
9340
+ functionDeclarations?: FunctionDeclaration[];
9294
9341
  /** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
9295
9342
  googleMaps?: GoogleMaps;
9296
9343
  /** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
9297
9344
  googleSearch?: GoogleSearch;
9345
+ /** Optional. Specialized retrieval tool that is powered by Google Search. */
9346
+ googleSearchRetrieval?: GoogleSearchRetrieval;
9298
9347
  /** Optional. Tool to support URL context retrieval. */
9299
9348
  urlContext?: UrlContext;
9300
9349
  }
@@ -9404,10 +9453,10 @@ export declare interface ToolCodeExecution {
9404
9453
 
9405
9454
  This config is shared for all tools provided in the request. */
9406
9455
  export declare interface ToolConfig {
9407
- /** Optional. Function calling config. */
9408
- functionCallingConfig?: FunctionCallingConfig;
9409
9456
  /** Optional. Retrieval config. */
9410
9457
  retrievalConfig?: RetrievalConfig;
9458
+ /** Optional. Function calling config. */
9459
+ functionCallingConfig?: FunctionCallingConfig;
9411
9460
  }
9412
9461
 
9413
9462
  export declare type ToolListUnion = ToolUnion[];
@@ -9697,7 +9746,7 @@ declare interface Turn {
9697
9746
  /**
9698
9747
  * The content of the turn.
9699
9748
  */
9700
- content?: string | Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
9749
+ content?: string | Array<Content_2>;
9701
9750
  /**
9702
9751
  * The originator of this turn. Must be user for input or model for
9703
9752
  * model output.
@@ -9794,11 +9843,13 @@ declare namespace types {
9794
9843
  Language,
9795
9844
  FunctionResponseScheduling,
9796
9845
  Type,
9797
- Mode,
9798
9846
  ApiSpec,
9799
9847
  AuthType,
9800
9848
  HttpElementLocation,
9801
9849
  PhishBlockThreshold,
9850
+ Behavior,
9851
+ DynamicRetrievalConfigMode,
9852
+ FunctionCallingConfigMode,
9802
9853
  ThinkingLevel,
9803
9854
  HarmCategory,
9804
9855
  HarmBlockMethod,
@@ -9817,10 +9868,7 @@ declare namespace types {
9817
9868
  TuningTask,
9818
9869
  PartMediaResolutionLevel,
9819
9870
  FeatureSelectionPreference,
9820
- Behavior,
9821
- DynamicRetrievalConfigMode,
9822
9871
  Environment,
9823
- FunctionCallingConfigMode,
9824
9872
  SafetyFilterLevel,
9825
9873
  PersonGeneration,
9826
9874
  ImagePromptLanguage,
@@ -9839,6 +9887,7 @@ declare namespace types {
9839
9887
  TurnCompleteReason,
9840
9888
  MediaModality,
9841
9889
  VadSignalType,
9890
+ VoiceActivityType,
9842
9891
  StartSensitivity,
9843
9892
  EndSensitivity,
9844
9893
  ActivityHandling,
@@ -9863,9 +9912,6 @@ declare namespace types {
9863
9912
  HttpOptions,
9864
9913
  Schema,
9865
9914
  ModelSelectionConfig,
9866
- FunctionDeclaration,
9867
- DynamicRetrievalConfig,
9868
- GoogleSearchRetrieval,
9869
9915
  ComputerUse,
9870
9916
  FileSearch,
9871
9917
  ApiAuthApiKeyConfig,
@@ -9892,14 +9938,17 @@ declare namespace types {
9892
9938
  Retrieval,
9893
9939
  ToolCodeExecution,
9894
9940
  EnterpriseWebSearch,
9941
+ FunctionDeclaration,
9895
9942
  GoogleMaps,
9896
9943
  Interval,
9897
9944
  GoogleSearch,
9945
+ DynamicRetrievalConfig,
9946
+ GoogleSearchRetrieval,
9898
9947
  UrlContext,
9899
9948
  Tool,
9900
- FunctionCallingConfig,
9901
9949
  LatLng,
9902
9950
  RetrievalConfig,
9951
+ FunctionCallingConfig,
9903
9952
  ToolConfig,
9904
9953
  ReplicatedVoiceConfig,
9905
9954
  PrebuiltVoiceConfig,
@@ -10161,6 +10210,7 @@ declare namespace types {
10161
10210
  LiveServerGoAway,
10162
10211
  LiveServerSessionResumptionUpdate,
10163
10212
  VoiceActivityDetectionSignal,
10213
+ VoiceActivity,
10164
10214
  LiveServerMessage,
10165
10215
  OperationFromAPIResponseParameters,
10166
10216
  GenerationConfigThinkingConfig,
@@ -10208,6 +10258,8 @@ declare namespace types {
10208
10258
  CreateAuthTokenConfig,
10209
10259
  CreateAuthTokenParameters,
10210
10260
  OperationGetParameters,
10261
+ CountTokensResult,
10262
+ ComputeTokensResult,
10211
10263
  CreateTuningJobParameters,
10212
10264
  UploadToFileSearchStoreResponse,
10213
10265
  UploadToFileSearchStoreOperation,
@@ -10642,7 +10694,7 @@ declare interface Usage {
10642
10694
  /**
10643
10695
  * Number of tokens of thoughts for thinking models.
10644
10696
  */
10645
- total_reasoning_tokens?: number;
10697
+ total_thought_tokens?: number;
10646
10698
  /**
10647
10699
  * Total token count for the interaction request (prompt + responses + other
10648
10700
  * internal tokens).
@@ -10848,6 +10900,9 @@ export declare enum VideoCompressionQuality {
10848
10900
  */
10849
10901
  declare interface VideoContent {
10850
10902
  type: 'video';
10903
+ /**
10904
+ * The video content.
10905
+ */
10851
10906
  data?: string;
10852
10907
  /**
10853
10908
  * The mime type of the video.
@@ -10857,6 +10912,9 @@ declare interface VideoContent {
10857
10912
  * The resolution of the media.
10858
10913
  */
10859
10914
  resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
10915
+ /**
10916
+ * The URI of the video.
10917
+ */
10860
10918
  uri?: string;
10861
10919
  }
10862
10920
 
@@ -10936,11 +10994,33 @@ export declare interface VideoMetadata {
10936
10994
  */
10937
10995
  declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
10938
10996
 
10997
+ /** Voice activity signal. */
10998
+ export declare interface VoiceActivity {
10999
+ /** The type of the voice activity signal. */
11000
+ voiceActivityType?: VoiceActivityType;
11001
+ }
11002
+
10939
11003
  export declare interface VoiceActivityDetectionSignal {
10940
11004
  /** The type of the VAD signal. */
10941
11005
  vadSignalType?: VadSignalType;
10942
11006
  }
10943
11007
 
11008
+ /** The type of the voice activity signal. */
11009
+ export declare enum VoiceActivityType {
11010
+ /**
11011
+ * The default is VOICE_ACTIVITY_TYPE_UNSPECIFIED.
11012
+ */
11013
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
11014
+ /**
11015
+ * Start of sentence signal.
11016
+ */
11017
+ ACTIVITY_START = "ACTIVITY_START",
11018
+ /**
11019
+ * End of sentence signal.
11020
+ */
11021
+ ACTIVITY_END = "ACTIVITY_END"
11022
+ }
11023
+
10944
11024
  export declare interface VoiceConfig {
10945
11025
  /** If true, the model will use a replicated voice for the response. */
10946
11026
  replicatedVoiceConfig?: ReplicatedVoiceConfig;