@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.
- package/README.md +233 -1
- package/dist/genai.d.ts +117 -201
- package/dist/index.cjs +304 -293
- package/dist/index.mjs +305 -294
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +304 -296
- package/dist/node/index.mjs +305 -297
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +117 -201
- package/dist/web/index.mjs +305 -297
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +117 -201
- package/package.json +1 -1
package/dist/genai.d.ts
CHANGED
|
@@ -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<
|
|
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<
|
|
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 }
|
|
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
|
-
/**
|
|
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
|
-
|
|
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?:
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
3734
|
+
/** Function calling mode. */
|
|
3793
3735
|
export declare enum FunctionCallingConfigMode {
|
|
3794
3736
|
/**
|
|
3795
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
@@ -5005,9 +4953,6 @@ declare interface GoogleSearchCallArguments {
|
|
|
5005
4953
|
* Google Search content.
|
|
5006
4954
|
*/
|
|
5007
4955
|
declare interface GoogleSearchCallContent {
|
|
5008
|
-
/**
|
|
5009
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5010
|
-
*/
|
|
5011
4956
|
type: 'google_search_call';
|
|
5012
4957
|
/**
|
|
5013
4958
|
* A unique ID for this specific tool call.
|
|
@@ -5041,9 +4986,6 @@ declare interface GoogleSearchResult {
|
|
|
5041
4986
|
* Google Search result content.
|
|
5042
4987
|
*/
|
|
5043
4988
|
declare interface GoogleSearchResultContent {
|
|
5044
|
-
/**
|
|
5045
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5046
|
-
*/
|
|
5047
4989
|
type: 'google_search_result';
|
|
5048
4990
|
/**
|
|
5049
4991
|
* ID to match the ID from the google search call block.
|
|
@@ -5478,6 +5420,9 @@ export declare interface ImageConfig {
|
|
|
5478
5420
|
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
5479
5421
|
value `1K`. */
|
|
5480
5422
|
imageSize?: string;
|
|
5423
|
+
/** Controls the generation of people. Supported values are:
|
|
5424
|
+
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5425
|
+
personGeneration?: string;
|
|
5481
5426
|
/** MIME type of the generated image. This field is not
|
|
5482
5427
|
supported in Gemini API. */
|
|
5483
5428
|
outputMimeType?: string;
|
|
@@ -5490,9 +5435,6 @@ export declare interface ImageConfig {
|
|
|
5490
5435
|
* An image content block.
|
|
5491
5436
|
*/
|
|
5492
5437
|
declare interface ImageContent {
|
|
5493
|
-
/**
|
|
5494
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5495
|
-
*/
|
|
5496
5438
|
type: 'image';
|
|
5497
5439
|
data?: string;
|
|
5498
5440
|
/**
|
|
@@ -5502,7 +5444,7 @@ declare interface ImageContent {
|
|
|
5502
5444
|
/**
|
|
5503
5445
|
* The resolution of the media.
|
|
5504
5446
|
*/
|
|
5505
|
-
resolution?: 'low' | 'medium' | 'high';
|
|
5447
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
5506
5448
|
uri?: string;
|
|
5507
5449
|
}
|
|
5508
5450
|
|
|
@@ -5665,14 +5607,10 @@ declare interface Interaction {
|
|
|
5665
5607
|
* The name of the `Model` used for generating the interaction.
|
|
5666
5608
|
*/
|
|
5667
5609
|
model?: Model_2;
|
|
5668
|
-
/**
|
|
5669
|
-
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5670
|
-
*/
|
|
5671
|
-
object?: 'interaction';
|
|
5672
5610
|
/**
|
|
5673
5611
|
* Output only. Responses from the model.
|
|
5674
5612
|
*/
|
|
5675
|
-
outputs?: Array<
|
|
5613
|
+
outputs?: Array<Content_2>;
|
|
5676
5614
|
/**
|
|
5677
5615
|
* The ID of the previous interaction, if any.
|
|
5678
5616
|
*/
|
|
@@ -5712,8 +5650,7 @@ declare type InteractionDeleteResponse = unknown;
|
|
|
5712
5650
|
|
|
5713
5651
|
declare interface InteractionEvent {
|
|
5714
5652
|
/**
|
|
5715
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5716
|
-
* this event.
|
|
5653
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5717
5654
|
*/
|
|
5718
5655
|
event_id?: string;
|
|
5719
5656
|
event_type?: 'interaction.start' | 'interaction.complete';
|
|
@@ -5763,7 +5700,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5763
5700
|
}
|
|
5764
5701
|
|
|
5765
5702
|
export declare namespace Interactions {
|
|
5766
|
-
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, };
|
|
5703
|
+
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, };
|
|
5767
5704
|
}
|
|
5768
5705
|
|
|
5769
5706
|
declare namespace InteractionsAPI {
|
|
@@ -5777,11 +5714,13 @@ declare namespace InteractionsAPI {
|
|
|
5777
5714
|
CodeExecutionCallArguments,
|
|
5778
5715
|
CodeExecutionCallContent,
|
|
5779
5716
|
CodeExecutionResultContent,
|
|
5717
|
+
Content_2 as Content,
|
|
5780
5718
|
ContentDelta,
|
|
5781
5719
|
ContentStart,
|
|
5782
5720
|
ContentStop,
|
|
5783
5721
|
DeepResearchAgentConfig,
|
|
5784
5722
|
DocumentContent,
|
|
5723
|
+
DocumentMimeType,
|
|
5785
5724
|
DynamicAgentConfig,
|
|
5786
5725
|
ErrorEvent_2 as ErrorEvent,
|
|
5787
5726
|
FileSearchResultContent,
|
|
@@ -5839,8 +5778,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
|
|
|
5839
5778
|
|
|
5840
5779
|
declare interface InteractionStatusUpdate {
|
|
5841
5780
|
/**
|
|
5842
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5843
|
-
* this event.
|
|
5781
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5844
5782
|
*/
|
|
5845
5783
|
event_id?: string;
|
|
5846
5784
|
event_type?: 'interaction.status_update';
|
|
@@ -7027,9 +6965,6 @@ declare interface MCPServerToolCallContent {
|
|
|
7027
6965
|
* The name of the used MCP server.
|
|
7028
6966
|
*/
|
|
7029
6967
|
server_name: string;
|
|
7030
|
-
/**
|
|
7031
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
7032
|
-
*/
|
|
7033
6968
|
type: 'mcp_server_tool_call';
|
|
7034
6969
|
}
|
|
7035
6970
|
|
|
@@ -7045,9 +6980,6 @@ declare interface MCPServerToolResultContent {
|
|
|
7045
6980
|
* The result of the tool call.
|
|
7046
6981
|
*/
|
|
7047
6982
|
result: MCPServerToolResultContent.Items | unknown | string;
|
|
7048
|
-
/**
|
|
7049
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
7050
|
-
*/
|
|
7051
6983
|
type: 'mcp_server_tool_result';
|
|
7052
6984
|
/**
|
|
7053
6985
|
* Name of the tool which is called for this specific tool call.
|
|
@@ -7061,7 +6993,7 @@ declare interface MCPServerToolResultContent {
|
|
|
7061
6993
|
|
|
7062
6994
|
declare namespace MCPServerToolResultContent {
|
|
7063
6995
|
interface Items {
|
|
7064
|
-
items?: Array<string | InteractionsAPI.ImageContent>;
|
|
6996
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
7065
6997
|
}
|
|
7066
6998
|
}
|
|
7067
6999
|
|
|
@@ -7161,18 +7093,6 @@ export declare interface ModalityTokenCount {
|
|
|
7161
7093
|
tokenCount?: number;
|
|
7162
7094
|
}
|
|
7163
7095
|
|
|
7164
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
7165
|
-
export declare enum Mode {
|
|
7166
|
-
/**
|
|
7167
|
-
* Always trigger retrieval.
|
|
7168
|
-
*/
|
|
7169
|
-
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
7170
|
-
/**
|
|
7171
|
-
* Run retrieval only when system decides it is necessary.
|
|
7172
|
-
*/
|
|
7173
|
-
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
7174
|
-
}
|
|
7175
|
-
|
|
7176
7096
|
/** A trained machine learning model. */
|
|
7177
7097
|
export declare interface Model {
|
|
7178
7098
|
/** Resource name of the model. */
|
|
@@ -7231,7 +7151,7 @@ export declare interface Model {
|
|
|
7231
7151
|
/**
|
|
7232
7152
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7233
7153
|
*/
|
|
7234
|
-
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 & {});
|
|
7154
|
+
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 & {});
|
|
7235
7155
|
|
|
7236
7156
|
export declare class Models extends BaseModule {
|
|
7237
7157
|
private readonly apiClient;
|
|
@@ -7343,7 +7263,7 @@ export declare class Models extends BaseModule {
|
|
|
7343
7263
|
* @example
|
|
7344
7264
|
* ```ts
|
|
7345
7265
|
* const response = await client.models.generateImages({
|
|
7346
|
-
* model: 'imagen-
|
|
7266
|
+
* model: 'imagen-4.0-generate-001',
|
|
7347
7267
|
* prompt: 'Robot holding a red skateboard',
|
|
7348
7268
|
* config: {
|
|
7349
7269
|
* numberOfImages: 1,
|
|
@@ -7386,7 +7306,7 @@ export declare class Models extends BaseModule {
|
|
|
7386
7306
|
* @example
|
|
7387
7307
|
* ```ts
|
|
7388
7308
|
* const response = await client.models.upscaleImage({
|
|
7389
|
-
* model: 'imagen-
|
|
7309
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
7390
7310
|
* image: image,
|
|
7391
7311
|
* upscaleFactor: 'x2',
|
|
7392
7312
|
* config: {
|
|
@@ -7485,7 +7405,7 @@ export declare class Models extends BaseModule {
|
|
|
7485
7405
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
7486
7406
|
*
|
|
7487
7407
|
* const response2 = await ai.models.recontextImage({
|
|
7488
|
-
* model: 'virtual-try-on-
|
|
7408
|
+
* model: 'virtual-try-on-001',
|
|
7489
7409
|
* source: {
|
|
7490
7410
|
* personImage: personImage,
|
|
7491
7411
|
* productImages: [productImage],
|
|
@@ -7607,9 +7527,9 @@ export declare interface ModelSelectionConfig {
|
|
|
7607
7527
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
7608
7528
|
}
|
|
7609
7529
|
|
|
7610
|
-
/**
|
|
7530
|
+
/** Configuration for a multi-speaker text-to-speech request. */
|
|
7611
7531
|
export declare interface MultiSpeakerVoiceConfig {
|
|
7612
|
-
/** Required.
|
|
7532
|
+
/** Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided. */
|
|
7613
7533
|
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
7614
7534
|
}
|
|
7615
7535
|
|
|
@@ -7978,7 +7898,11 @@ export declare enum PartMediaResolutionLevel {
|
|
|
7978
7898
|
/**
|
|
7979
7899
|
* Media resolution set to high.
|
|
7980
7900
|
*/
|
|
7981
|
-
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
7901
|
+
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH",
|
|
7902
|
+
/**
|
|
7903
|
+
* Media resolution set to ultra high.
|
|
7904
|
+
*/
|
|
7905
|
+
MEDIA_RESOLUTION_ULTRA_HIGH = "MEDIA_RESOLUTION_ULTRA_HIGH"
|
|
7982
7906
|
}
|
|
7983
7907
|
|
|
7984
7908
|
/** Tuning spec for Partner models. This data type is not supported in Gemini API. */
|
|
@@ -8920,7 +8844,7 @@ export declare interface SpeechConfig {
|
|
|
8920
8844
|
voiceConfig?: VoiceConfig;
|
|
8921
8845
|
/** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
|
|
8922
8846
|
languageCode?: string;
|
|
8923
|
-
/**
|
|
8847
|
+
/** The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`. */
|
|
8924
8848
|
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
8925
8849
|
}
|
|
8926
8850
|
|
|
@@ -9170,9 +9094,6 @@ export declare interface TestTableItem {
|
|
|
9170
9094
|
* A text content block.
|
|
9171
9095
|
*/
|
|
9172
9096
|
declare interface TextContent {
|
|
9173
|
-
/**
|
|
9174
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
9175
|
-
*/
|
|
9176
9097
|
type: 'text';
|
|
9177
9098
|
/**
|
|
9178
9099
|
* Citation information for model-generated content.
|
|
@@ -9192,35 +9113,40 @@ export declare interface ThinkingConfig {
|
|
|
9192
9113
|
/** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
|
|
9193
9114
|
*/
|
|
9194
9115
|
thinkingBudget?: number;
|
|
9195
|
-
/** Optional. The
|
|
9116
|
+
/** Optional. The number of thoughts tokens that the model should generate. */
|
|
9196
9117
|
thinkingLevel?: ThinkingLevel;
|
|
9197
9118
|
}
|
|
9198
9119
|
|
|
9199
|
-
/** The
|
|
9120
|
+
/** The number of thoughts tokens that the model should generate. */
|
|
9200
9121
|
export declare enum ThinkingLevel {
|
|
9201
9122
|
/**
|
|
9202
|
-
*
|
|
9123
|
+
* Unspecified thinking level.
|
|
9203
9124
|
*/
|
|
9204
9125
|
THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
|
|
9205
9126
|
/**
|
|
9206
9127
|
* Low thinking level.
|
|
9207
9128
|
*/
|
|
9208
9129
|
LOW = "LOW",
|
|
9130
|
+
/**
|
|
9131
|
+
* Medium thinking level.
|
|
9132
|
+
*/
|
|
9133
|
+
MEDIUM = "MEDIUM",
|
|
9209
9134
|
/**
|
|
9210
9135
|
* High thinking level.
|
|
9211
9136
|
*/
|
|
9212
|
-
HIGH = "HIGH"
|
|
9137
|
+
HIGH = "HIGH",
|
|
9138
|
+
/**
|
|
9139
|
+
* MINIMAL thinking level.
|
|
9140
|
+
*/
|
|
9141
|
+
MINIMAL = "MINIMAL"
|
|
9213
9142
|
}
|
|
9214
9143
|
|
|
9215
|
-
declare type ThinkingLevel_2 = 'low' | 'high';
|
|
9144
|
+
declare type ThinkingLevel_2 = 'minimal' | 'low' | 'medium' | 'high';
|
|
9216
9145
|
|
|
9217
9146
|
/**
|
|
9218
9147
|
* A thought content block.
|
|
9219
9148
|
*/
|
|
9220
9149
|
declare interface ThoughtContent {
|
|
9221
|
-
/**
|
|
9222
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
9223
|
-
*/
|
|
9224
9150
|
type: 'thought';
|
|
9225
9151
|
/**
|
|
9226
9152
|
* Signature to match the backend source to be part of the generation.
|
|
@@ -9334,12 +9260,8 @@ export declare interface TokensInfo {
|
|
|
9334
9260
|
|
|
9335
9261
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
9336
9262
|
export declare interface Tool {
|
|
9337
|
-
/** List of function declarations that the tool supports. */
|
|
9338
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
9339
9263
|
/** 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. */
|
|
9340
9264
|
retrieval?: Retrieval;
|
|
9341
|
-
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9342
|
-
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9343
9265
|
/** Optional. Tool to support the model interacting directly with the
|
|
9344
9266
|
computer. If enabled, it automatically populates computer-use specific
|
|
9345
9267
|
Function Declarations. */
|
|
@@ -9350,10 +9272,14 @@ export declare interface Tool {
|
|
|
9350
9272
|
codeExecution?: ToolCodeExecution;
|
|
9351
9273
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
9352
9274
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
9275
|
+
/** 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. */
|
|
9276
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
9353
9277
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9354
9278
|
googleMaps?: GoogleMaps;
|
|
9355
9279
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9356
9280
|
googleSearch?: GoogleSearch;
|
|
9281
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9282
|
+
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9357
9283
|
/** Optional. Tool to support URL context retrieval. */
|
|
9358
9284
|
urlContext?: UrlContext;
|
|
9359
9285
|
}
|
|
@@ -9463,10 +9389,10 @@ export declare interface ToolCodeExecution {
|
|
|
9463
9389
|
|
|
9464
9390
|
This config is shared for all tools provided in the request. */
|
|
9465
9391
|
export declare interface ToolConfig {
|
|
9466
|
-
/** Optional. Function calling config. */
|
|
9467
|
-
functionCallingConfig?: FunctionCallingConfig;
|
|
9468
9392
|
/** Optional. Retrieval config. */
|
|
9469
9393
|
retrievalConfig?: RetrievalConfig;
|
|
9394
|
+
/** Optional. Function calling config. */
|
|
9395
|
+
functionCallingConfig?: FunctionCallingConfig;
|
|
9470
9396
|
}
|
|
9471
9397
|
|
|
9472
9398
|
export declare type ToolListUnion = ToolUnion[];
|
|
@@ -9756,7 +9682,7 @@ declare interface Turn {
|
|
|
9756
9682
|
/**
|
|
9757
9683
|
* The content of the turn.
|
|
9758
9684
|
*/
|
|
9759
|
-
content?: string | Array<
|
|
9685
|
+
content?: string | Array<Content_2>;
|
|
9760
9686
|
/**
|
|
9761
9687
|
* The originator of this turn. Must be user for input or model for
|
|
9762
9688
|
* model output.
|
|
@@ -9853,11 +9779,13 @@ declare namespace types {
|
|
|
9853
9779
|
Language,
|
|
9854
9780
|
FunctionResponseScheduling,
|
|
9855
9781
|
Type,
|
|
9856
|
-
Mode,
|
|
9857
9782
|
ApiSpec,
|
|
9858
9783
|
AuthType,
|
|
9859
9784
|
HttpElementLocation,
|
|
9860
9785
|
PhishBlockThreshold,
|
|
9786
|
+
Behavior,
|
|
9787
|
+
DynamicRetrievalConfigMode,
|
|
9788
|
+
FunctionCallingConfigMode,
|
|
9861
9789
|
ThinkingLevel,
|
|
9862
9790
|
HarmCategory,
|
|
9863
9791
|
HarmBlockMethod,
|
|
@@ -9876,10 +9804,7 @@ declare namespace types {
|
|
|
9876
9804
|
TuningTask,
|
|
9877
9805
|
PartMediaResolutionLevel,
|
|
9878
9806
|
FeatureSelectionPreference,
|
|
9879
|
-
Behavior,
|
|
9880
|
-
DynamicRetrievalConfigMode,
|
|
9881
9807
|
Environment,
|
|
9882
|
-
FunctionCallingConfigMode,
|
|
9883
9808
|
SafetyFilterLevel,
|
|
9884
9809
|
PersonGeneration,
|
|
9885
9810
|
ImagePromptLanguage,
|
|
@@ -9922,9 +9847,6 @@ declare namespace types {
|
|
|
9922
9847
|
HttpOptions,
|
|
9923
9848
|
Schema,
|
|
9924
9849
|
ModelSelectionConfig,
|
|
9925
|
-
FunctionDeclaration,
|
|
9926
|
-
DynamicRetrievalConfig,
|
|
9927
|
-
GoogleSearchRetrieval,
|
|
9928
9850
|
ComputerUse,
|
|
9929
9851
|
FileSearch,
|
|
9930
9852
|
ApiAuthApiKeyConfig,
|
|
@@ -9951,14 +9873,17 @@ declare namespace types {
|
|
|
9951
9873
|
Retrieval,
|
|
9952
9874
|
ToolCodeExecution,
|
|
9953
9875
|
EnterpriseWebSearch,
|
|
9876
|
+
FunctionDeclaration,
|
|
9954
9877
|
GoogleMaps,
|
|
9955
9878
|
Interval,
|
|
9956
9879
|
GoogleSearch,
|
|
9880
|
+
DynamicRetrievalConfig,
|
|
9881
|
+
GoogleSearchRetrieval,
|
|
9957
9882
|
UrlContext,
|
|
9958
9883
|
Tool,
|
|
9959
|
-
FunctionCallingConfig,
|
|
9960
9884
|
LatLng,
|
|
9961
9885
|
RetrievalConfig,
|
|
9886
|
+
FunctionCallingConfig,
|
|
9962
9887
|
ToolConfig,
|
|
9963
9888
|
ReplicatedVoiceConfig,
|
|
9964
9889
|
PrebuiltVoiceConfig,
|
|
@@ -10580,9 +10505,6 @@ declare interface URLContextCallArguments {
|
|
|
10580
10505
|
* URL context content.
|
|
10581
10506
|
*/
|
|
10582
10507
|
declare interface URLContextCallContent {
|
|
10583
|
-
/**
|
|
10584
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10585
|
-
*/
|
|
10586
10508
|
type: 'url_context_call';
|
|
10587
10509
|
/**
|
|
10588
10510
|
* A unique ID for this specific tool call.
|
|
@@ -10618,9 +10540,6 @@ declare interface URLContextResult {
|
|
|
10618
10540
|
* URL context result content.
|
|
10619
10541
|
*/
|
|
10620
10542
|
declare interface URLContextResultContent {
|
|
10621
|
-
/**
|
|
10622
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10623
|
-
*/
|
|
10624
10543
|
type: 'url_context_result';
|
|
10625
10544
|
/**
|
|
10626
10545
|
* ID to match the ID from the url context call block.
|
|
@@ -10707,7 +10626,7 @@ declare interface Usage {
|
|
|
10707
10626
|
/**
|
|
10708
10627
|
* Number of tokens of thoughts for thinking models.
|
|
10709
10628
|
*/
|
|
10710
|
-
|
|
10629
|
+
total_thought_tokens?: number;
|
|
10711
10630
|
/**
|
|
10712
10631
|
* Total token count for the interaction request (prompt + responses + other
|
|
10713
10632
|
* internal tokens).
|
|
@@ -10912,9 +10831,6 @@ export declare enum VideoCompressionQuality {
|
|
|
10912
10831
|
* A video content block.
|
|
10913
10832
|
*/
|
|
10914
10833
|
declare interface VideoContent {
|
|
10915
|
-
/**
|
|
10916
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10917
|
-
*/
|
|
10918
10834
|
type: 'video';
|
|
10919
10835
|
data?: string;
|
|
10920
10836
|
/**
|
|
@@ -10924,7 +10840,7 @@ declare interface VideoContent {
|
|
|
10924
10840
|
/**
|
|
10925
10841
|
* The resolution of the media.
|
|
10926
10842
|
*/
|
|
10927
|
-
resolution?: 'low' | 'medium' | 'high';
|
|
10843
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
10928
10844
|
uri?: string;
|
|
10929
10845
|
}
|
|
10930
10846
|
|