@google/genai 1.33.0 → 1.35.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.
@@ -119,7 +119,7 @@ export declare interface ApiAuthApiKeyConfig {
119
119
  * The ApiClient class is used to send requests to the Gemini API or Vertex AI
120
120
  * endpoints.
121
121
  */
122
- declare class ApiClient {
122
+ declare class ApiClient implements GeminiNextGenAPIClientAdapter {
123
123
  readonly clientOptions: ApiClientInitOptions;
124
124
  constructor(opts: ApiClientInitOptions);
125
125
  /**
@@ -140,6 +140,7 @@ declare class ApiClient {
140
140
  isVertexAI(): boolean;
141
141
  getProject(): string | undefined;
142
142
  getLocation(): string | undefined;
143
+ getAuthHeaders(): Promise<Headers>;
143
144
  getApiVersion(): string;
144
145
  getBaseUrl(): string;
145
146
  getRequestUrl(): string;
@@ -415,9 +416,6 @@ export declare interface AudioChunk {
415
416
  * An audio content block.
416
417
  */
417
418
  declare interface AudioContent {
418
- /**
419
- * Used as the OpenAPI type discriminator for the content oneof.
420
- */
421
419
  type: 'audio';
422
420
  data?: string;
423
421
  /**
@@ -583,7 +581,7 @@ declare interface BaseCreateAgentInteractionParams {
583
581
  /**
584
582
  * Body param: The inputs for the interaction.
585
583
  */
586
- 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;
584
+ input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
587
585
  /**
588
586
  * Path param: Which version of the API to use.
589
587
  */
@@ -635,7 +633,7 @@ declare interface BaseCreateModelInteractionParams {
635
633
  /**
636
634
  * Body param: The inputs for the interaction.
637
635
  */
638
- 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;
636
+ input: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
639
637
  /**
640
638
  * Body param: The name of the `Model` used for generating the interaction.
641
639
  */
@@ -703,6 +701,7 @@ declare class BaseGeminiNextGenAPIClient {
703
701
  private encoder;
704
702
  protected idempotencyHeader?: string;
705
703
  private _options;
704
+ private clientAdapter;
706
705
  /**
707
706
  * API Client for interfacing with the Gemini Next Gen API API.
708
707
  *
@@ -716,7 +715,7 @@ declare class BaseGeminiNextGenAPIClient {
716
715
  * @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
717
716
  * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
718
717
  */
719
- constructor({ baseURL, apiKey, apiVersion, ...opts }?: ClientOptions);
718
+ constructor({ baseURL, apiKey, apiVersion, ...opts }: ClientOptions);
720
719
  /**
721
720
  * Create a new client instance re-using the same options given to the current client with optional overriding.
722
721
  */
@@ -738,6 +737,7 @@ declare class BaseGeminiNextGenAPIClient {
738
737
  buildURL(path: string, query: Record<string, unknown> | null | undefined, defaultBaseURL?: string | undefined): string;
739
738
  /**
740
739
  * Used as a callback for mutating the given `FinalRequestOptions` object.
740
+
741
741
  */
742
742
  protected prepareOptions(options: FinalRequestOptions): Promise<void>;
743
743
  /**
@@ -1045,7 +1045,7 @@ export declare interface BatchJobSource {
1045
1045
 
1046
1046
  export declare type BatchJobSourceUnion = BatchJobSource | InlinedRequest[] | string;
1047
1047
 
1048
- /** Defines the function behavior. Defaults to `BLOCKING`. */
1048
+ /** Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This enum is not supported in Vertex AI. */
1049
1049
  export declare enum Behavior {
1050
1050
  /**
1051
1051
  * This value is unused.
@@ -1578,6 +1578,10 @@ declare interface ClientOptions {
1578
1578
  * Defaults to globalThis.console.
1579
1579
  */
1580
1580
  logger?: Logger | undefined;
1581
+ /**
1582
+ * The adapter to the parent API client instance (for accessing auth, project, location)
1583
+ */
1584
+ clientAdapter: GeminiNextGenAPIClientAdapter;
1581
1585
  }
1582
1586
 
1583
1587
  /**
@@ -1598,9 +1602,6 @@ declare interface CodeExecutionCallArguments {
1598
1602
  * Code execution content.
1599
1603
  */
1600
1604
  declare interface CodeExecutionCallContent {
1601
- /**
1602
- * Used as the OpenAPI type discriminator for the content oneof.
1603
- */
1604
1605
  type: 'code_execution_call';
1605
1606
  /**
1606
1607
  * A unique ID for this specific tool call.
@@ -1624,9 +1625,6 @@ export declare interface CodeExecutionResult {
1624
1625
  * Code execution result content.
1625
1626
  */
1626
1627
  declare interface CodeExecutionResultContent {
1627
- /**
1628
- * Used as the OpenAPI type discriminator for the content oneof.
1629
- */
1630
1628
  type: 'code_execution_result';
1631
1629
  /**
1632
1630
  * ID to match the ID from the code execution call block.
@@ -1719,11 +1717,15 @@ export declare interface Content {
1719
1717
  role?: string;
1720
1718
  }
1721
1719
 
1720
+ /**
1721
+ * The content of the response.
1722
+ */
1723
+ declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
1724
+
1722
1725
  declare interface ContentDelta {
1723
1726
  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;
1724
1727
  /**
1725
- * The event_id token to be used to resume the interaction stream, from
1726
- * this event.
1728
+ * The event_id token to be used to resume the interaction stream, from this event.
1727
1729
  */
1728
1730
  event_id?: string;
1729
1731
  event_type?: 'content.delta';
@@ -1732,9 +1734,6 @@ declare interface ContentDelta {
1732
1734
 
1733
1735
  declare namespace ContentDelta {
1734
1736
  interface TextDelta {
1735
- /**
1736
- * Used as the OpenAPI type discriminator for the content oneof.
1737
- */
1738
1737
  type: 'text';
1739
1738
  /**
1740
1739
  * Citation information for model-generated content.
@@ -1743,9 +1742,6 @@ declare namespace ContentDelta {
1743
1742
  text?: string;
1744
1743
  }
1745
1744
  interface ImageDelta {
1746
- /**
1747
- * Used as the OpenAPI type discriminator for the content oneof.
1748
- */
1749
1745
  type: 'image';
1750
1746
  data?: string;
1751
1747
  /**
@@ -1755,13 +1751,10 @@ declare namespace ContentDelta {
1755
1751
  /**
1756
1752
  * The resolution of the media.
1757
1753
  */
1758
- resolution?: 'low' | 'medium' | 'high';
1754
+ resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
1759
1755
  uri?: string;
1760
1756
  }
1761
1757
  interface AudioDelta {
1762
- /**
1763
- * Used as the OpenAPI type discriminator for the content oneof.
1764
- */
1765
1758
  type: 'audio';
1766
1759
  data?: string;
1767
1760
  /**
@@ -1771,18 +1764,15 @@ declare namespace ContentDelta {
1771
1764
  uri?: string;
1772
1765
  }
1773
1766
  interface DocumentDelta {
1774
- /**
1775
- * Used as the OpenAPI type discriminator for the content oneof.
1776
- */
1777
1767
  type: 'document';
1778
1768
  data?: string;
1779
- mime_type?: string;
1769
+ /**
1770
+ * The mime type of the document.
1771
+ */
1772
+ mime_type?: InteractionsAPI.DocumentMimeType;
1780
1773
  uri?: string;
1781
1774
  }
1782
1775
  interface VideoDelta {
1783
- /**
1784
- * Used as the OpenAPI type discriminator for the content oneof.
1785
- */
1786
1776
  type: 'video';
1787
1777
  data?: string;
1788
1778
  /**
@@ -1792,13 +1782,10 @@ declare namespace ContentDelta {
1792
1782
  /**
1793
1783
  * The resolution of the media.
1794
1784
  */
1795
- resolution?: 'low' | 'medium' | 'high';
1785
+ resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
1796
1786
  uri?: string;
1797
1787
  }
1798
1788
  interface ThoughtSummaryDelta {
1799
- /**
1800
- * Used as the OpenAPI type discriminator for the content oneof.
1801
- */
1802
1789
  type: 'thought_summary';
1803
1790
  /**
1804
1791
  * A text content block.
@@ -1806,9 +1793,6 @@ declare namespace ContentDelta {
1806
1793
  content?: InteractionsAPI.TextContent | InteractionsAPI.ImageContent;
1807
1794
  }
1808
1795
  interface ThoughtSignatureDelta {
1809
- /**
1810
- * Used as the OpenAPI type discriminator for the content oneof.
1811
- */
1812
1796
  type: 'thought_signature';
1813
1797
  /**
1814
1798
  * Signature to match the backend source to be part of the generation.
@@ -1816,9 +1800,6 @@ declare namespace ContentDelta {
1816
1800
  signature?: string;
1817
1801
  }
1818
1802
  interface FunctionCallDelta {
1819
- /**
1820
- * Used as the OpenAPI type discriminator for the content oneof.
1821
- */
1822
1803
  type: 'function_call';
1823
1804
  /**
1824
1805
  * A unique ID for this specific tool call.
@@ -1830,9 +1811,6 @@ declare namespace ContentDelta {
1830
1811
  name?: string;
1831
1812
  }
1832
1813
  interface FunctionResultDelta {
1833
- /**
1834
- * Used as the OpenAPI type discriminator for the content oneof.
1835
- */
1836
1814
  type: 'function_result';
1837
1815
  /**
1838
1816
  * ID to match the ID from the function call block.
@@ -1847,13 +1825,10 @@ declare namespace ContentDelta {
1847
1825
  }
1848
1826
  namespace FunctionResultDelta {
1849
1827
  interface Items {
1850
- items?: Array<string | InteractionsAPI.ImageContent>;
1828
+ items?: Array<string | InteractionsAPI.ImageContent | unknown>;
1851
1829
  }
1852
1830
  }
1853
1831
  interface CodeExecutionCallDelta {
1854
- /**
1855
- * Used as the OpenAPI type discriminator for the content oneof.
1856
- */
1857
1832
  type: 'code_execution_call';
1858
1833
  /**
1859
1834
  * A unique ID for this specific tool call.
@@ -1865,9 +1840,6 @@ declare namespace ContentDelta {
1865
1840
  arguments?: InteractionsAPI.CodeExecutionCallArguments;
1866
1841
  }
1867
1842
  interface CodeExecutionResultDelta {
1868
- /**
1869
- * Used as the OpenAPI type discriminator for the content oneof.
1870
- */
1871
1843
  type: 'code_execution_result';
1872
1844
  /**
1873
1845
  * ID to match the ID from the function call block.
@@ -1878,9 +1850,6 @@ declare namespace ContentDelta {
1878
1850
  signature?: string;
1879
1851
  }
1880
1852
  interface URLContextCallDelta {
1881
- /**
1882
- * Used as the OpenAPI type discriminator for the content oneof.
1883
- */
1884
1853
  type: 'url_context_call';
1885
1854
  /**
1886
1855
  * A unique ID for this specific tool call.
@@ -1892,9 +1861,6 @@ declare namespace ContentDelta {
1892
1861
  arguments?: InteractionsAPI.URLContextCallArguments;
1893
1862
  }
1894
1863
  interface URLContextResultDelta {
1895
- /**
1896
- * Used as the OpenAPI type discriminator for the content oneof.
1897
- */
1898
1864
  type: 'url_context_result';
1899
1865
  /**
1900
1866
  * ID to match the ID from the function call block.
@@ -1905,9 +1871,6 @@ declare namespace ContentDelta {
1905
1871
  signature?: string;
1906
1872
  }
1907
1873
  interface GoogleSearchCallDelta {
1908
- /**
1909
- * Used as the OpenAPI type discriminator for the content oneof.
1910
- */
1911
1874
  type: 'google_search_call';
1912
1875
  /**
1913
1876
  * A unique ID for this specific tool call.
@@ -1919,9 +1882,6 @@ declare namespace ContentDelta {
1919
1882
  arguments?: InteractionsAPI.GoogleSearchCallArguments;
1920
1883
  }
1921
1884
  interface GoogleSearchResultDelta {
1922
- /**
1923
- * Used as the OpenAPI type discriminator for the content oneof.
1924
- */
1925
1885
  type: 'google_search_result';
1926
1886
  /**
1927
1887
  * ID to match the ID from the function call block.
@@ -1932,9 +1892,6 @@ declare namespace ContentDelta {
1932
1892
  signature?: string;
1933
1893
  }
1934
1894
  interface MCPServerToolCallDelta {
1935
- /**
1936
- * Used as the OpenAPI type discriminator for the content oneof.
1937
- */
1938
1895
  type: 'mcp_server_tool_call';
1939
1896
  /**
1940
1897
  * A unique ID for this specific tool call.
@@ -1947,9 +1904,6 @@ declare namespace ContentDelta {
1947
1904
  server_name?: string;
1948
1905
  }
1949
1906
  interface MCPServerToolResultDelta {
1950
- /**
1951
- * Used as the OpenAPI type discriminator for the content oneof.
1952
- */
1953
1907
  type: 'mcp_server_tool_result';
1954
1908
  /**
1955
1909
  * ID to match the ID from the function call block.
@@ -1964,13 +1918,10 @@ declare namespace ContentDelta {
1964
1918
  }
1965
1919
  namespace MCPServerToolResultDelta {
1966
1920
  interface Items {
1967
- items?: Array<string | InteractionsAPI.ImageContent>;
1921
+ items?: Array<string | InteractionsAPI.ImageContent | unknown>;
1968
1922
  }
1969
1923
  }
1970
1924
  interface FileSearchResultDelta {
1971
- /**
1972
- * Used as the OpenAPI type discriminator for the content oneof.
1973
- */
1974
1925
  type: 'file_search_result';
1975
1926
  result?: Array<FileSearchResultDelta.Result>;
1976
1927
  }
@@ -2039,10 +1990,9 @@ declare interface ContentStart {
2039
1990
  /**
2040
1991
  * The content of the response.
2041
1992
  */
2042
- content?: TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent;
1993
+ content?: Content_2;
2043
1994
  /**
2044
- * The event_id token to be used to resume the interaction stream, from
2045
- * this event.
1995
+ * The event_id token to be used to resume the interaction stream, from this event.
2046
1996
  */
2047
1997
  event_id?: string;
2048
1998
  event_type?: 'content.start';
@@ -2051,8 +2001,7 @@ declare interface ContentStart {
2051
2001
 
2052
2002
  declare interface ContentStop {
2053
2003
  /**
2054
- * The event_id token to be used to resume the interaction stream, from
2055
- * this event.
2004
+ * The event_id token to be used to resume the interaction stream, from this event.
2056
2005
  */
2057
2006
  event_id?: string;
2058
2007
  event_type?: 'content.stop';
@@ -2603,9 +2552,6 @@ declare interface DeepResearchAgentConfig {
2603
2552
  * Whether to include thought summaries in the response.
2604
2553
  */
2605
2554
  thinking_summaries?: 'auto' | 'none';
2606
- /**
2607
- * Used as the OpenAPI type discriminator for the content oneof.
2608
- */
2609
2555
  type?: 'deep-research';
2610
2556
  }
2611
2557
 
@@ -2807,15 +2753,20 @@ export { Document_2 as Document }
2807
2753
  * A document content block.
2808
2754
  */
2809
2755
  declare interface DocumentContent {
2810
- /**
2811
- * Used as the OpenAPI type discriminator for the content oneof.
2812
- */
2813
2756
  type: 'document';
2814
2757
  data?: string;
2815
- mime_type?: string;
2758
+ /**
2759
+ * The mime type of the document.
2760
+ */
2761
+ mime_type?: DocumentMimeType;
2816
2762
  uri?: string;
2817
2763
  }
2818
2764
 
2765
+ /**
2766
+ * The mime type of the document.
2767
+ */
2768
+ declare type DocumentMimeType = (string & {}) | 'application/pdf';
2769
+
2819
2770
  declare class Documents extends BaseModule {
2820
2771
  private readonly apiClient;
2821
2772
  constructor(apiClient: ApiClient);
@@ -2901,22 +2852,19 @@ export declare interface DownloadFileParameters {
2901
2852
  * Configuration for dynamic agents.
2902
2853
  */
2903
2854
  declare interface DynamicAgentConfig {
2904
- /**
2905
- * Used as the OpenAPI type discriminator for the content oneof.
2906
- */
2907
2855
  type?: 'dynamic';
2908
2856
  [k: string]: unknown;
2909
2857
  }
2910
2858
 
2911
2859
  /** Describes the options to customize dynamic retrieval. */
2912
2860
  export declare interface DynamicRetrievalConfig {
2913
- /** The mode of the predictor to be used in dynamic retrieval. */
2914
- mode?: DynamicRetrievalConfigMode;
2915
2861
  /** Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used. */
2916
2862
  dynamicThreshold?: number;
2863
+ /** The mode of the predictor to be used in dynamic retrieval. */
2864
+ mode?: DynamicRetrievalConfigMode;
2917
2865
  }
2918
2866
 
2919
- /** Config for the dynamic retrieval config mode. */
2867
+ /** The mode of the predictor to be used in dynamic retrieval. */
2920
2868
  export declare enum DynamicRetrievalConfigMode {
2921
2869
  /**
2922
2870
  * Always trigger retrieval.
@@ -3167,8 +3115,7 @@ declare interface ErrorEvent_2 {
3167
3115
  */
3168
3116
  error?: ErrorEvent_2.Error;
3169
3117
  /**
3170
- * The event_id token to be used to resume the interaction stream, from
3171
- * this event.
3118
+ * The event_id token to be used to resume the interaction stream, from this event.
3172
3119
  */
3173
3120
  event_id?: string;
3174
3121
  event_type?: 'error';
@@ -3456,9 +3403,6 @@ export declare interface FileSearch {
3456
3403
  * File Search result content.
3457
3404
  */
3458
3405
  declare interface FileSearchResultContent {
3459
- /**
3460
- * Used as the OpenAPI type discriminator for the content oneof.
3461
- */
3462
3406
  type: 'file_search_result';
3463
3407
  /**
3464
3408
  * The results of the File Search.
@@ -3600,7 +3544,8 @@ declare class FileSearchStores extends BaseModule {
3600
3544
  export declare enum FileSource {
3601
3545
  SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED",
3602
3546
  UPLOADED = "UPLOADED",
3603
- GENERATED = "GENERATED"
3547
+ GENERATED = "GENERATED",
3548
+ REGISTERED = "REGISTERED"
3604
3549
  }
3605
3550
 
3606
3551
  /**
@@ -3773,26 +3718,23 @@ declare interface FunctionCallContent {
3773
3718
  * The name of the tool to call.
3774
3719
  */
3775
3720
  name: string;
3776
- /**
3777
- * Used as the OpenAPI type discriminator for the content oneof.
3778
- */
3779
3721
  type: 'function_call';
3780
3722
  }
3781
3723
 
3782
3724
  /** Function calling config. */
3783
3725
  export declare interface FunctionCallingConfig {
3784
- /** Optional. Function calling mode. */
3785
- mode?: FunctionCallingConfigMode;
3786
3726
  /** 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. */
3787
3727
  allowedFunctionNames?: string[];
3728
+ /** Optional. Function calling mode. */
3729
+ mode?: FunctionCallingConfigMode;
3788
3730
  /** 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. */
3789
3731
  streamFunctionCallArguments?: boolean;
3790
3732
  }
3791
3733
 
3792
- /** Config for the function calling config mode. */
3734
+ /** Function calling mode. */
3793
3735
  export declare enum FunctionCallingConfigMode {
3794
3736
  /**
3795
- * The function calling config mode is unspecified. Should not be used.
3737
+ * Unspecified function calling mode. This value should not be used.
3796
3738
  */
3797
3739
  MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
3798
3740
  /**
@@ -3808,18 +3750,13 @@ export declare enum FunctionCallingConfigMode {
3808
3750
  */
3809
3751
  NONE = "NONE",
3810
3752
  /**
3811
- * 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".
3753
+ * 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".
3812
3754
  */
3813
3755
  VALIDATED = "VALIDATED"
3814
3756
  }
3815
3757
 
3816
- /** Defines a function that the model can generate JSON inputs for.
3817
-
3818
- The inputs are based on `OpenAPI 3.0 specifications
3819
- <https://spec.openapis.org/oas/v3.0.3>`_. */
3758
+ /** 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. */
3820
3759
  export declare interface FunctionDeclaration {
3821
- /** Defines the function behavior. */
3822
- behavior?: Behavior;
3823
3760
  /** Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function. */
3824
3761
  description?: string;
3825
3762
  /** 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. */
@@ -3832,6 +3769,8 @@ export declare interface FunctionDeclaration {
3832
3769
  response?: Schema;
3833
3770
  /** 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`. */
3834
3771
  responseJsonSchema?: unknown;
3772
+ /** Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method. This field is not supported in Vertex AI. */
3773
+ behavior?: Behavior;
3835
3774
  }
3836
3775
 
3837
3776
  /** A function response. */
@@ -3925,9 +3864,6 @@ declare interface FunctionResultContent {
3925
3864
  * The result of the tool call.
3926
3865
  */
3927
3866
  result: FunctionResultContent.Items | unknown | string;
3928
- /**
3929
- * Used as the OpenAPI type discriminator for the content oneof.
3930
- */
3931
3867
  type: 'function_result';
3932
3868
  /**
3933
3869
  * Whether the tool call resulted in an error.
@@ -3941,10 +3877,22 @@ declare interface FunctionResultContent {
3941
3877
 
3942
3878
  declare namespace FunctionResultContent {
3943
3879
  interface Items {
3944
- items?: Array<string | InteractionsAPI.ImageContent>;
3880
+ items?: Array<string | InteractionsAPI.ImageContent | unknown>;
3945
3881
  }
3946
3882
  }
3947
3883
 
3884
+ /**
3885
+ * @license
3886
+ * Copyright 2025 Google LLC
3887
+ * SPDX-License-Identifier: Apache-2.0
3888
+ */
3889
+ declare interface GeminiNextGenAPIClientAdapter {
3890
+ isVertexAI: () => boolean;
3891
+ getProject: () => string | undefined;
3892
+ getLocation: () => string | undefined;
3893
+ getAuthHeaders: () => Headers | Promise<Headers>;
3894
+ }
3895
+
3948
3896
  /**
3949
3897
  * @license
3950
3898
  * Copyright 2025 Google LLC
@@ -5017,9 +4965,6 @@ declare interface GoogleSearchCallArguments {
5017
4965
  * Google Search content.
5018
4966
  */
5019
4967
  declare interface GoogleSearchCallContent {
5020
- /**
5021
- * Used as the OpenAPI type discriminator for the content oneof.
5022
- */
5023
4968
  type: 'google_search_call';
5024
4969
  /**
5025
4970
  * A unique ID for this specific tool call.
@@ -5053,9 +4998,6 @@ declare interface GoogleSearchResult {
5053
4998
  * Google Search result content.
5054
4999
  */
5055
5000
  declare interface GoogleSearchResultContent {
5056
- /**
5057
- * Used as the OpenAPI type discriminator for the content oneof.
5058
- */
5059
5001
  type: 'google_search_result';
5060
5002
  /**
5061
5003
  * ID to match the ID from the google search call block.
@@ -5490,6 +5432,9 @@ export declare interface ImageConfig {
5490
5432
  values are `1K`, `2K`, `4K`. If not specified, the model will use default
5491
5433
  value `1K`. */
5492
5434
  imageSize?: string;
5435
+ /** Controls the generation of people. Supported values are:
5436
+ ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
5437
+ personGeneration?: string;
5493
5438
  /** MIME type of the generated image. This field is not
5494
5439
  supported in Gemini API. */
5495
5440
  outputMimeType?: string;
@@ -5502,9 +5447,6 @@ export declare interface ImageConfig {
5502
5447
  * An image content block.
5503
5448
  */
5504
5449
  declare interface ImageContent {
5505
- /**
5506
- * Used as the OpenAPI type discriminator for the content oneof.
5507
- */
5508
5450
  type: 'image';
5509
5451
  data?: string;
5510
5452
  /**
@@ -5514,7 +5456,7 @@ declare interface ImageContent {
5514
5456
  /**
5515
5457
  * The resolution of the media.
5516
5458
  */
5517
- resolution?: 'low' | 'medium' | 'high';
5459
+ resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
5518
5460
  uri?: string;
5519
5461
  }
5520
5462
 
@@ -5677,14 +5619,10 @@ declare interface Interaction {
5677
5619
  * The name of the `Model` used for generating the interaction.
5678
5620
  */
5679
5621
  model?: Model_2;
5680
- /**
5681
- * Output only. The object type of the interaction. Always set to `interaction`.
5682
- */
5683
- object?: 'interaction';
5684
5622
  /**
5685
5623
  * Output only. Responses from the model.
5686
5624
  */
5687
- outputs?: Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
5625
+ outputs?: Array<Content_2>;
5688
5626
  /**
5689
5627
  * The ID of the previous interaction, if any.
5690
5628
  */
@@ -5724,8 +5662,7 @@ declare type InteractionDeleteResponse = unknown;
5724
5662
 
5725
5663
  declare interface InteractionEvent {
5726
5664
  /**
5727
- * The event_id token to be used to resume the interaction stream, from
5728
- * this event.
5665
+ * The event_id token to be used to resume the interaction stream, from this event.
5729
5666
  */
5730
5667
  event_id?: string;
5731
5668
  event_type?: 'interaction.start' | 'interaction.complete';
@@ -5775,7 +5712,7 @@ export declare class Interactions extends BaseInteractions {
5775
5712
  }
5776
5713
 
5777
5714
  export declare namespace Interactions {
5778
- 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 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, };
5715
+ 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 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, };
5779
5716
  }
5780
5717
 
5781
5718
  declare namespace InteractionsAPI {
@@ -5789,11 +5726,13 @@ declare namespace InteractionsAPI {
5789
5726
  CodeExecutionCallArguments,
5790
5727
  CodeExecutionCallContent,
5791
5728
  CodeExecutionResultContent,
5729
+ Content_2 as Content,
5792
5730
  ContentDelta,
5793
5731
  ContentStart,
5794
5732
  ContentStop,
5795
5733
  DeepResearchAgentConfig,
5796
5734
  DocumentContent,
5735
+ DocumentMimeType,
5797
5736
  DynamicAgentConfig,
5798
5737
  ErrorEvent_2 as ErrorEvent,
5799
5738
  FileSearchResultContent,
@@ -5851,8 +5790,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
5851
5790
 
5852
5791
  declare interface InteractionStatusUpdate {
5853
5792
  /**
5854
- * The event_id token to be used to resume the interaction stream, from
5855
- * this event.
5793
+ * The event_id token to be used to resume the interaction stream, from this event.
5856
5794
  */
5857
5795
  event_id?: string;
5858
5796
  event_type?: 'interaction.status_update';
@@ -7039,9 +6977,6 @@ declare interface MCPServerToolCallContent {
7039
6977
  * The name of the used MCP server.
7040
6978
  */
7041
6979
  server_name: string;
7042
- /**
7043
- * Used as the OpenAPI type discriminator for the content oneof.
7044
- */
7045
6980
  type: 'mcp_server_tool_call';
7046
6981
  }
7047
6982
 
@@ -7057,9 +6992,6 @@ declare interface MCPServerToolResultContent {
7057
6992
  * The result of the tool call.
7058
6993
  */
7059
6994
  result: MCPServerToolResultContent.Items | unknown | string;
7060
- /**
7061
- * Used as the OpenAPI type discriminator for the content oneof.
7062
- */
7063
6995
  type: 'mcp_server_tool_result';
7064
6996
  /**
7065
6997
  * Name of the tool which is called for this specific tool call.
@@ -7073,7 +7005,7 @@ declare interface MCPServerToolResultContent {
7073
7005
 
7074
7006
  declare namespace MCPServerToolResultContent {
7075
7007
  interface Items {
7076
- items?: Array<string | InteractionsAPI.ImageContent>;
7008
+ items?: Array<string | InteractionsAPI.ImageContent | unknown>;
7077
7009
  }
7078
7010
  }
7079
7011
 
@@ -7173,18 +7105,6 @@ export declare interface ModalityTokenCount {
7173
7105
  tokenCount?: number;
7174
7106
  }
7175
7107
 
7176
- /** The mode of the predictor to be used in dynamic retrieval. */
7177
- export declare enum Mode {
7178
- /**
7179
- * Always trigger retrieval.
7180
- */
7181
- MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
7182
- /**
7183
- * Run retrieval only when system decides it is necessary.
7184
- */
7185
- MODE_DYNAMIC = "MODE_DYNAMIC"
7186
- }
7187
-
7188
7108
  /** A trained machine learning model. */
7189
7109
  export declare interface Model {
7190
7110
  /** Resource name of the model. */
@@ -7243,7 +7163,7 @@ export declare interface Model {
7243
7163
  /**
7244
7164
  * The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
7245
7165
  */
7246
- 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 & {});
7166
+ 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 & {});
7247
7167
 
7248
7168
  export declare class Models extends BaseModule {
7249
7169
  private readonly apiClient;
@@ -7355,7 +7275,7 @@ export declare class Models extends BaseModule {
7355
7275
  * @example
7356
7276
  * ```ts
7357
7277
  * const response = await client.models.generateImages({
7358
- * model: 'imagen-3.0-generate-002',
7278
+ * model: 'imagen-4.0-generate-001',
7359
7279
  * prompt: 'Robot holding a red skateboard',
7360
7280
  * config: {
7361
7281
  * numberOfImages: 1,
@@ -7398,7 +7318,7 @@ export declare class Models extends BaseModule {
7398
7318
  * @example
7399
7319
  * ```ts
7400
7320
  * const response = await client.models.upscaleImage({
7401
- * model: 'imagen-3.0-generate-002',
7321
+ * model: 'imagen-4.0-upscale-preview',
7402
7322
  * image: image,
7403
7323
  * upscaleFactor: 'x2',
7404
7324
  * config: {
@@ -7497,7 +7417,7 @@ export declare class Models extends BaseModule {
7497
7417
  * console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
7498
7418
  *
7499
7419
  * const response2 = await ai.models.recontextImage({
7500
- * model: 'virtual-try-on-preview-08-04',
7420
+ * model: 'virtual-try-on-001',
7501
7421
  * source: {
7502
7422
  * personImage: personImage,
7503
7423
  * productImages: [productImage],
@@ -7619,9 +7539,9 @@ export declare interface ModelSelectionConfig {
7619
7539
  featureSelectionPreference?: FeatureSelectionPreference;
7620
7540
  }
7621
7541
 
7622
- /** The configuration for the multi-speaker setup. This data type is not supported in Vertex AI. */
7542
+ /** Configuration for a multi-speaker text-to-speech request. */
7623
7543
  export declare interface MultiSpeakerVoiceConfig {
7624
- /** Required. All the enabled speaker voices. */
7544
+ /** Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided. */
7625
7545
  speakerVoiceConfigs?: SpeakerVoiceConfig[];
7626
7546
  }
7627
7547
 
@@ -7990,7 +7910,11 @@ export declare enum PartMediaResolutionLevel {
7990
7910
  /**
7991
7911
  * Media resolution set to high.
7992
7912
  */
7993
- MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
7913
+ MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH",
7914
+ /**
7915
+ * Media resolution set to ultra high.
7916
+ */
7917
+ MEDIA_RESOLUTION_ULTRA_HIGH = "MEDIA_RESOLUTION_ULTRA_HIGH"
7994
7918
  }
7995
7919
 
7996
7920
  /** Tuning spec for Partner models. This data type is not supported in Gemini API. */
@@ -8932,7 +8856,7 @@ export declare interface SpeechConfig {
8932
8856
  voiceConfig?: VoiceConfig;
8933
8857
  /** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
8934
8858
  languageCode?: string;
8935
- /** Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI. */
8859
+ /** The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`. */
8936
8860
  multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
8937
8861
  }
8938
8862
 
@@ -9182,9 +9106,6 @@ export declare interface TestTableItem {
9182
9106
  * A text content block.
9183
9107
  */
9184
9108
  declare interface TextContent {
9185
- /**
9186
- * Used as the OpenAPI type discriminator for the content oneof.
9187
- */
9188
9109
  type: 'text';
9189
9110
  /**
9190
9111
  * Citation information for model-generated content.
@@ -9204,35 +9125,40 @@ export declare interface ThinkingConfig {
9204
9125
  /** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
9205
9126
  */
9206
9127
  thinkingBudget?: number;
9207
- /** Optional. The level of thoughts tokens that the model should generate. */
9128
+ /** Optional. The number of thoughts tokens that the model should generate. */
9208
9129
  thinkingLevel?: ThinkingLevel;
9209
9130
  }
9210
9131
 
9211
- /** The level of thoughts tokens that the model should generate. */
9132
+ /** The number of thoughts tokens that the model should generate. */
9212
9133
  export declare enum ThinkingLevel {
9213
9134
  /**
9214
- * Default value.
9135
+ * Unspecified thinking level.
9215
9136
  */
9216
9137
  THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
9217
9138
  /**
9218
9139
  * Low thinking level.
9219
9140
  */
9220
9141
  LOW = "LOW",
9142
+ /**
9143
+ * Medium thinking level.
9144
+ */
9145
+ MEDIUM = "MEDIUM",
9221
9146
  /**
9222
9147
  * High thinking level.
9223
9148
  */
9224
- HIGH = "HIGH"
9149
+ HIGH = "HIGH",
9150
+ /**
9151
+ * MINIMAL thinking level.
9152
+ */
9153
+ MINIMAL = "MINIMAL"
9225
9154
  }
9226
9155
 
9227
- declare type ThinkingLevel_2 = 'low' | 'high';
9156
+ declare type ThinkingLevel_2 = 'minimal' | 'low' | 'medium' | 'high';
9228
9157
 
9229
9158
  /**
9230
9159
  * A thought content block.
9231
9160
  */
9232
9161
  declare interface ThoughtContent {
9233
- /**
9234
- * Used as the OpenAPI type discriminator for the content oneof.
9235
- */
9236
9162
  type: 'thought';
9237
9163
  /**
9238
9164
  * Signature to match the backend source to be part of the generation.
@@ -9346,12 +9272,8 @@ export declare interface TokensInfo {
9346
9272
 
9347
9273
  /** Tool details of a tool that the model may use to generate a response. */
9348
9274
  export declare interface Tool {
9349
- /** List of function declarations that the tool supports. */
9350
- functionDeclarations?: FunctionDeclaration[];
9351
9275
  /** 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. */
9352
9276
  retrieval?: Retrieval;
9353
- /** Optional. Specialized retrieval tool that is powered by Google Search. */
9354
- googleSearchRetrieval?: GoogleSearchRetrieval;
9355
9277
  /** Optional. Tool to support the model interacting directly with the
9356
9278
  computer. If enabled, it automatically populates computer-use specific
9357
9279
  Function Declarations. */
@@ -9362,10 +9284,14 @@ export declare interface Tool {
9362
9284
  codeExecution?: ToolCodeExecution;
9363
9285
  /** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
9364
9286
  enterpriseWebSearch?: EnterpriseWebSearch;
9287
+ /** 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. */
9288
+ functionDeclarations?: FunctionDeclaration[];
9365
9289
  /** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
9366
9290
  googleMaps?: GoogleMaps;
9367
9291
  /** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
9368
9292
  googleSearch?: GoogleSearch;
9293
+ /** Optional. Specialized retrieval tool that is powered by Google Search. */
9294
+ googleSearchRetrieval?: GoogleSearchRetrieval;
9369
9295
  /** Optional. Tool to support URL context retrieval. */
9370
9296
  urlContext?: UrlContext;
9371
9297
  }
@@ -9475,10 +9401,10 @@ export declare interface ToolCodeExecution {
9475
9401
 
9476
9402
  This config is shared for all tools provided in the request. */
9477
9403
  export declare interface ToolConfig {
9478
- /** Optional. Function calling config. */
9479
- functionCallingConfig?: FunctionCallingConfig;
9480
9404
  /** Optional. Retrieval config. */
9481
9405
  retrievalConfig?: RetrievalConfig;
9406
+ /** Optional. Function calling config. */
9407
+ functionCallingConfig?: FunctionCallingConfig;
9482
9408
  }
9483
9409
 
9484
9410
  export declare type ToolListUnion = ToolUnion[];
@@ -9768,7 +9694,7 @@ declare interface Turn {
9768
9694
  /**
9769
9695
  * The content of the turn.
9770
9696
  */
9771
- content?: string | Array<TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchResultContent>;
9697
+ content?: string | Array<Content_2>;
9772
9698
  /**
9773
9699
  * The originator of this turn. Must be user for input or model for
9774
9700
  * model output.
@@ -9865,11 +9791,13 @@ declare namespace types {
9865
9791
  Language,
9866
9792
  FunctionResponseScheduling,
9867
9793
  Type,
9868
- Mode,
9869
9794
  ApiSpec,
9870
9795
  AuthType,
9871
9796
  HttpElementLocation,
9872
9797
  PhishBlockThreshold,
9798
+ Behavior,
9799
+ DynamicRetrievalConfigMode,
9800
+ FunctionCallingConfigMode,
9873
9801
  ThinkingLevel,
9874
9802
  HarmCategory,
9875
9803
  HarmBlockMethod,
@@ -9888,10 +9816,7 @@ declare namespace types {
9888
9816
  TuningTask,
9889
9817
  PartMediaResolutionLevel,
9890
9818
  FeatureSelectionPreference,
9891
- Behavior,
9892
- DynamicRetrievalConfigMode,
9893
9819
  Environment,
9894
- FunctionCallingConfigMode,
9895
9820
  SafetyFilterLevel,
9896
9821
  PersonGeneration,
9897
9822
  ImagePromptLanguage,
@@ -9934,9 +9859,6 @@ declare namespace types {
9934
9859
  HttpOptions,
9935
9860
  Schema,
9936
9861
  ModelSelectionConfig,
9937
- FunctionDeclaration,
9938
- DynamicRetrievalConfig,
9939
- GoogleSearchRetrieval,
9940
9862
  ComputerUse,
9941
9863
  FileSearch,
9942
9864
  ApiAuthApiKeyConfig,
@@ -9963,14 +9885,17 @@ declare namespace types {
9963
9885
  Retrieval,
9964
9886
  ToolCodeExecution,
9965
9887
  EnterpriseWebSearch,
9888
+ FunctionDeclaration,
9966
9889
  GoogleMaps,
9967
9890
  Interval,
9968
9891
  GoogleSearch,
9892
+ DynamicRetrievalConfig,
9893
+ GoogleSearchRetrieval,
9969
9894
  UrlContext,
9970
9895
  Tool,
9971
- FunctionCallingConfig,
9972
9896
  LatLng,
9973
9897
  RetrievalConfig,
9898
+ FunctionCallingConfig,
9974
9899
  ToolConfig,
9975
9900
  ReplicatedVoiceConfig,
9976
9901
  PrebuiltVoiceConfig,
@@ -10592,9 +10517,6 @@ declare interface URLContextCallArguments {
10592
10517
  * URL context content.
10593
10518
  */
10594
10519
  declare interface URLContextCallContent {
10595
- /**
10596
- * Used as the OpenAPI type discriminator for the content oneof.
10597
- */
10598
10520
  type: 'url_context_call';
10599
10521
  /**
10600
10522
  * A unique ID for this specific tool call.
@@ -10630,9 +10552,6 @@ declare interface URLContextResult {
10630
10552
  * URL context result content.
10631
10553
  */
10632
10554
  declare interface URLContextResultContent {
10633
- /**
10634
- * Used as the OpenAPI type discriminator for the content oneof.
10635
- */
10636
10555
  type: 'url_context_result';
10637
10556
  /**
10638
10557
  * ID to match the ID from the url context call block.
@@ -10719,7 +10638,7 @@ declare interface Usage {
10719
10638
  /**
10720
10639
  * Number of tokens of thoughts for thinking models.
10721
10640
  */
10722
- total_reasoning_tokens?: number;
10641
+ total_thought_tokens?: number;
10723
10642
  /**
10724
10643
  * Total token count for the interaction request (prompt + responses + other
10725
10644
  * internal tokens).
@@ -10924,9 +10843,6 @@ export declare enum VideoCompressionQuality {
10924
10843
  * A video content block.
10925
10844
  */
10926
10845
  declare interface VideoContent {
10927
- /**
10928
- * Used as the OpenAPI type discriminator for the content oneof.
10929
- */
10930
10846
  type: 'video';
10931
10847
  data?: string;
10932
10848
  /**
@@ -10936,7 +10852,7 @@ declare interface VideoContent {
10936
10852
  /**
10937
10853
  * The resolution of the media.
10938
10854
  */
10939
- resolution?: 'low' | 'medium' | 'high';
10855
+ resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
10940
10856
  uri?: string;
10941
10857
  }
10942
10858