@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/web/web.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
|
|
@@ -5010,9 +4958,6 @@ declare interface GoogleSearchCallArguments {
|
|
|
5010
4958
|
* Google Search content.
|
|
5011
4959
|
*/
|
|
5012
4960
|
declare interface GoogleSearchCallContent {
|
|
5013
|
-
/**
|
|
5014
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5015
|
-
*/
|
|
5016
4961
|
type: 'google_search_call';
|
|
5017
4962
|
/**
|
|
5018
4963
|
* A unique ID for this specific tool call.
|
|
@@ -5046,9 +4991,6 @@ declare interface GoogleSearchResult {
|
|
|
5046
4991
|
* Google Search result content.
|
|
5047
4992
|
*/
|
|
5048
4993
|
declare interface GoogleSearchResultContent {
|
|
5049
|
-
/**
|
|
5050
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5051
|
-
*/
|
|
5052
4994
|
type: 'google_search_result';
|
|
5053
4995
|
/**
|
|
5054
4996
|
* ID to match the ID from the google search call block.
|
|
@@ -5483,6 +5425,9 @@ export declare interface ImageConfig {
|
|
|
5483
5425
|
values are `1K`, `2K`, `4K`. If not specified, the model will use default
|
|
5484
5426
|
value `1K`. */
|
|
5485
5427
|
imageSize?: string;
|
|
5428
|
+
/** Controls the generation of people. Supported values are:
|
|
5429
|
+
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5430
|
+
personGeneration?: string;
|
|
5486
5431
|
/** MIME type of the generated image. This field is not
|
|
5487
5432
|
supported in Gemini API. */
|
|
5488
5433
|
outputMimeType?: string;
|
|
@@ -5495,9 +5440,6 @@ export declare interface ImageConfig {
|
|
|
5495
5440
|
* An image content block.
|
|
5496
5441
|
*/
|
|
5497
5442
|
declare interface ImageContent {
|
|
5498
|
-
/**
|
|
5499
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
5500
|
-
*/
|
|
5501
5443
|
type: 'image';
|
|
5502
5444
|
data?: string;
|
|
5503
5445
|
/**
|
|
@@ -5507,7 +5449,7 @@ declare interface ImageContent {
|
|
|
5507
5449
|
/**
|
|
5508
5450
|
* The resolution of the media.
|
|
5509
5451
|
*/
|
|
5510
|
-
resolution?: 'low' | 'medium' | 'high';
|
|
5452
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
5511
5453
|
uri?: string;
|
|
5512
5454
|
}
|
|
5513
5455
|
|
|
@@ -5670,14 +5612,10 @@ declare interface Interaction {
|
|
|
5670
5612
|
* The name of the `Model` used for generating the interaction.
|
|
5671
5613
|
*/
|
|
5672
5614
|
model?: Model_2;
|
|
5673
|
-
/**
|
|
5674
|
-
* Output only. The object type of the interaction. Always set to `interaction`.
|
|
5675
|
-
*/
|
|
5676
|
-
object?: 'interaction';
|
|
5677
5615
|
/**
|
|
5678
5616
|
* Output only. Responses from the model.
|
|
5679
5617
|
*/
|
|
5680
|
-
outputs?: Array<
|
|
5618
|
+
outputs?: Array<Content_2>;
|
|
5681
5619
|
/**
|
|
5682
5620
|
* The ID of the previous interaction, if any.
|
|
5683
5621
|
*/
|
|
@@ -5717,8 +5655,7 @@ declare type InteractionDeleteResponse = unknown;
|
|
|
5717
5655
|
|
|
5718
5656
|
declare interface InteractionEvent {
|
|
5719
5657
|
/**
|
|
5720
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5721
|
-
* this event.
|
|
5658
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5722
5659
|
*/
|
|
5723
5660
|
event_id?: string;
|
|
5724
5661
|
event_type?: 'interaction.start' | 'interaction.complete';
|
|
@@ -5768,7 +5705,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5768
5705
|
}
|
|
5769
5706
|
|
|
5770
5707
|
export declare namespace Interactions {
|
|
5771
|
-
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, };
|
|
5708
|
+
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, };
|
|
5772
5709
|
}
|
|
5773
5710
|
|
|
5774
5711
|
declare namespace InteractionsAPI {
|
|
@@ -5782,11 +5719,13 @@ declare namespace InteractionsAPI {
|
|
|
5782
5719
|
CodeExecutionCallArguments,
|
|
5783
5720
|
CodeExecutionCallContent,
|
|
5784
5721
|
CodeExecutionResultContent,
|
|
5722
|
+
Content_2 as Content,
|
|
5785
5723
|
ContentDelta,
|
|
5786
5724
|
ContentStart,
|
|
5787
5725
|
ContentStop,
|
|
5788
5726
|
DeepResearchAgentConfig,
|
|
5789
5727
|
DocumentContent,
|
|
5728
|
+
DocumentMimeType,
|
|
5790
5729
|
DynamicAgentConfig,
|
|
5791
5730
|
ErrorEvent_2 as ErrorEvent,
|
|
5792
5731
|
FileSearchResultContent,
|
|
@@ -5844,8 +5783,7 @@ declare type InteractionSSEEvent = InteractionEvent | InteractionStatusUpdate |
|
|
|
5844
5783
|
|
|
5845
5784
|
declare interface InteractionStatusUpdate {
|
|
5846
5785
|
/**
|
|
5847
|
-
* The event_id token to be used to resume the interaction stream, from
|
|
5848
|
-
* this event.
|
|
5786
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5849
5787
|
*/
|
|
5850
5788
|
event_id?: string;
|
|
5851
5789
|
event_type?: 'interaction.status_update';
|
|
@@ -7032,9 +6970,6 @@ declare interface MCPServerToolCallContent {
|
|
|
7032
6970
|
* The name of the used MCP server.
|
|
7033
6971
|
*/
|
|
7034
6972
|
server_name: string;
|
|
7035
|
-
/**
|
|
7036
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
7037
|
-
*/
|
|
7038
6973
|
type: 'mcp_server_tool_call';
|
|
7039
6974
|
}
|
|
7040
6975
|
|
|
@@ -7050,9 +6985,6 @@ declare interface MCPServerToolResultContent {
|
|
|
7050
6985
|
* The result of the tool call.
|
|
7051
6986
|
*/
|
|
7052
6987
|
result: MCPServerToolResultContent.Items | unknown | string;
|
|
7053
|
-
/**
|
|
7054
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
7055
|
-
*/
|
|
7056
6988
|
type: 'mcp_server_tool_result';
|
|
7057
6989
|
/**
|
|
7058
6990
|
* Name of the tool which is called for this specific tool call.
|
|
@@ -7066,7 +6998,7 @@ declare interface MCPServerToolResultContent {
|
|
|
7066
6998
|
|
|
7067
6999
|
declare namespace MCPServerToolResultContent {
|
|
7068
7000
|
interface Items {
|
|
7069
|
-
items?: Array<string | InteractionsAPI.ImageContent>;
|
|
7001
|
+
items?: Array<string | InteractionsAPI.ImageContent | unknown>;
|
|
7070
7002
|
}
|
|
7071
7003
|
}
|
|
7072
7004
|
|
|
@@ -7166,18 +7098,6 @@ export declare interface ModalityTokenCount {
|
|
|
7166
7098
|
tokenCount?: number;
|
|
7167
7099
|
}
|
|
7168
7100
|
|
|
7169
|
-
/** The mode of the predictor to be used in dynamic retrieval. */
|
|
7170
|
-
export declare enum Mode {
|
|
7171
|
-
/**
|
|
7172
|
-
* Always trigger retrieval.
|
|
7173
|
-
*/
|
|
7174
|
-
MODE_UNSPECIFIED = "MODE_UNSPECIFIED",
|
|
7175
|
-
/**
|
|
7176
|
-
* Run retrieval only when system decides it is necessary.
|
|
7177
|
-
*/
|
|
7178
|
-
MODE_DYNAMIC = "MODE_DYNAMIC"
|
|
7179
|
-
}
|
|
7180
|
-
|
|
7181
7101
|
/** A trained machine learning model. */
|
|
7182
7102
|
export declare interface Model {
|
|
7183
7103
|
/** Resource name of the model. */
|
|
@@ -7236,7 +7156,7 @@ export declare interface Model {
|
|
|
7236
7156
|
/**
|
|
7237
7157
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7238
7158
|
*/
|
|
7239
|
-
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 & {});
|
|
7159
|
+
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 & {});
|
|
7240
7160
|
|
|
7241
7161
|
export declare class Models extends BaseModule {
|
|
7242
7162
|
private readonly apiClient;
|
|
@@ -7348,7 +7268,7 @@ export declare class Models extends BaseModule {
|
|
|
7348
7268
|
* @example
|
|
7349
7269
|
* ```ts
|
|
7350
7270
|
* const response = await client.models.generateImages({
|
|
7351
|
-
* model: 'imagen-
|
|
7271
|
+
* model: 'imagen-4.0-generate-001',
|
|
7352
7272
|
* prompt: 'Robot holding a red skateboard',
|
|
7353
7273
|
* config: {
|
|
7354
7274
|
* numberOfImages: 1,
|
|
@@ -7391,7 +7311,7 @@ export declare class Models extends BaseModule {
|
|
|
7391
7311
|
* @example
|
|
7392
7312
|
* ```ts
|
|
7393
7313
|
* const response = await client.models.upscaleImage({
|
|
7394
|
-
* model: 'imagen-
|
|
7314
|
+
* model: 'imagen-4.0-upscale-preview',
|
|
7395
7315
|
* image: image,
|
|
7396
7316
|
* upscaleFactor: 'x2',
|
|
7397
7317
|
* config: {
|
|
@@ -7490,7 +7410,7 @@ export declare class Models extends BaseModule {
|
|
|
7490
7410
|
* console.log(response1?.generatedImages?.[0]?.image?.imageBytes);
|
|
7491
7411
|
*
|
|
7492
7412
|
* const response2 = await ai.models.recontextImage({
|
|
7493
|
-
* model: 'virtual-try-on-
|
|
7413
|
+
* model: 'virtual-try-on-001',
|
|
7494
7414
|
* source: {
|
|
7495
7415
|
* personImage: personImage,
|
|
7496
7416
|
* productImages: [productImage],
|
|
@@ -7612,9 +7532,9 @@ export declare interface ModelSelectionConfig {
|
|
|
7612
7532
|
featureSelectionPreference?: FeatureSelectionPreference;
|
|
7613
7533
|
}
|
|
7614
7534
|
|
|
7615
|
-
/**
|
|
7535
|
+
/** Configuration for a multi-speaker text-to-speech request. */
|
|
7616
7536
|
export declare interface MultiSpeakerVoiceConfig {
|
|
7617
|
-
/** Required.
|
|
7537
|
+
/** Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided. */
|
|
7618
7538
|
speakerVoiceConfigs?: SpeakerVoiceConfig[];
|
|
7619
7539
|
}
|
|
7620
7540
|
|
|
@@ -7983,7 +7903,11 @@ export declare enum PartMediaResolutionLevel {
|
|
|
7983
7903
|
/**
|
|
7984
7904
|
* Media resolution set to high.
|
|
7985
7905
|
*/
|
|
7986
|
-
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH"
|
|
7906
|
+
MEDIA_RESOLUTION_HIGH = "MEDIA_RESOLUTION_HIGH",
|
|
7907
|
+
/**
|
|
7908
|
+
* Media resolution set to ultra high.
|
|
7909
|
+
*/
|
|
7910
|
+
MEDIA_RESOLUTION_ULTRA_HIGH = "MEDIA_RESOLUTION_ULTRA_HIGH"
|
|
7987
7911
|
}
|
|
7988
7912
|
|
|
7989
7913
|
/** Tuning spec for Partner models. This data type is not supported in Gemini API. */
|
|
@@ -8925,7 +8849,7 @@ export declare interface SpeechConfig {
|
|
|
8925
8849
|
voiceConfig?: VoiceConfig;
|
|
8926
8850
|
/** Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization. */
|
|
8927
8851
|
languageCode?: string;
|
|
8928
|
-
/**
|
|
8852
|
+
/** The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`. */
|
|
8929
8853
|
multiSpeakerVoiceConfig?: MultiSpeakerVoiceConfig;
|
|
8930
8854
|
}
|
|
8931
8855
|
|
|
@@ -9175,9 +9099,6 @@ export declare interface TestTableItem {
|
|
|
9175
9099
|
* A text content block.
|
|
9176
9100
|
*/
|
|
9177
9101
|
declare interface TextContent {
|
|
9178
|
-
/**
|
|
9179
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
9180
|
-
*/
|
|
9181
9102
|
type: 'text';
|
|
9182
9103
|
/**
|
|
9183
9104
|
* Citation information for model-generated content.
|
|
@@ -9197,35 +9118,40 @@ export declare interface ThinkingConfig {
|
|
|
9197
9118
|
/** Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values and allowed ranges are model dependent.
|
|
9198
9119
|
*/
|
|
9199
9120
|
thinkingBudget?: number;
|
|
9200
|
-
/** Optional. The
|
|
9121
|
+
/** Optional. The number of thoughts tokens that the model should generate. */
|
|
9201
9122
|
thinkingLevel?: ThinkingLevel;
|
|
9202
9123
|
}
|
|
9203
9124
|
|
|
9204
|
-
/** The
|
|
9125
|
+
/** The number of thoughts tokens that the model should generate. */
|
|
9205
9126
|
export declare enum ThinkingLevel {
|
|
9206
9127
|
/**
|
|
9207
|
-
*
|
|
9128
|
+
* Unspecified thinking level.
|
|
9208
9129
|
*/
|
|
9209
9130
|
THINKING_LEVEL_UNSPECIFIED = "THINKING_LEVEL_UNSPECIFIED",
|
|
9210
9131
|
/**
|
|
9211
9132
|
* Low thinking level.
|
|
9212
9133
|
*/
|
|
9213
9134
|
LOW = "LOW",
|
|
9135
|
+
/**
|
|
9136
|
+
* Medium thinking level.
|
|
9137
|
+
*/
|
|
9138
|
+
MEDIUM = "MEDIUM",
|
|
9214
9139
|
/**
|
|
9215
9140
|
* High thinking level.
|
|
9216
9141
|
*/
|
|
9217
|
-
HIGH = "HIGH"
|
|
9142
|
+
HIGH = "HIGH",
|
|
9143
|
+
/**
|
|
9144
|
+
* MINIMAL thinking level.
|
|
9145
|
+
*/
|
|
9146
|
+
MINIMAL = "MINIMAL"
|
|
9218
9147
|
}
|
|
9219
9148
|
|
|
9220
|
-
declare type ThinkingLevel_2 = 'low' | 'high';
|
|
9149
|
+
declare type ThinkingLevel_2 = 'minimal' | 'low' | 'medium' | 'high';
|
|
9221
9150
|
|
|
9222
9151
|
/**
|
|
9223
9152
|
* A thought content block.
|
|
9224
9153
|
*/
|
|
9225
9154
|
declare interface ThoughtContent {
|
|
9226
|
-
/**
|
|
9227
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
9228
|
-
*/
|
|
9229
9155
|
type: 'thought';
|
|
9230
9156
|
/**
|
|
9231
9157
|
* Signature to match the backend source to be part of the generation.
|
|
@@ -9339,12 +9265,8 @@ export declare interface TokensInfo {
|
|
|
9339
9265
|
|
|
9340
9266
|
/** Tool details of a tool that the model may use to generate a response. */
|
|
9341
9267
|
export declare interface Tool {
|
|
9342
|
-
/** List of function declarations that the tool supports. */
|
|
9343
|
-
functionDeclarations?: FunctionDeclaration[];
|
|
9344
9268
|
/** 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. */
|
|
9345
9269
|
retrieval?: Retrieval;
|
|
9346
|
-
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9347
|
-
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9348
9270
|
/** Optional. Tool to support the model interacting directly with the
|
|
9349
9271
|
computer. If enabled, it automatically populates computer-use specific
|
|
9350
9272
|
Function Declarations. */
|
|
@@ -9355,10 +9277,14 @@ export declare interface Tool {
|
|
|
9355
9277
|
codeExecution?: ToolCodeExecution;
|
|
9356
9278
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
9357
9279
|
enterpriseWebSearch?: EnterpriseWebSearch;
|
|
9280
|
+
/** 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. */
|
|
9281
|
+
functionDeclarations?: FunctionDeclaration[];
|
|
9358
9282
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9359
9283
|
googleMaps?: GoogleMaps;
|
|
9360
9284
|
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9361
9285
|
googleSearch?: GoogleSearch;
|
|
9286
|
+
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9287
|
+
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9362
9288
|
/** Optional. Tool to support URL context retrieval. */
|
|
9363
9289
|
urlContext?: UrlContext;
|
|
9364
9290
|
}
|
|
@@ -9468,10 +9394,10 @@ export declare interface ToolCodeExecution {
|
|
|
9468
9394
|
|
|
9469
9395
|
This config is shared for all tools provided in the request. */
|
|
9470
9396
|
export declare interface ToolConfig {
|
|
9471
|
-
/** Optional. Function calling config. */
|
|
9472
|
-
functionCallingConfig?: FunctionCallingConfig;
|
|
9473
9397
|
/** Optional. Retrieval config. */
|
|
9474
9398
|
retrievalConfig?: RetrievalConfig;
|
|
9399
|
+
/** Optional. Function calling config. */
|
|
9400
|
+
functionCallingConfig?: FunctionCallingConfig;
|
|
9475
9401
|
}
|
|
9476
9402
|
|
|
9477
9403
|
export declare type ToolListUnion = ToolUnion[];
|
|
@@ -9761,7 +9687,7 @@ declare interface Turn {
|
|
|
9761
9687
|
/**
|
|
9762
9688
|
* The content of the turn.
|
|
9763
9689
|
*/
|
|
9764
|
-
content?: string | Array<
|
|
9690
|
+
content?: string | Array<Content_2>;
|
|
9765
9691
|
/**
|
|
9766
9692
|
* The originator of this turn. Must be user for input or model for
|
|
9767
9693
|
* model output.
|
|
@@ -9858,11 +9784,13 @@ declare namespace types {
|
|
|
9858
9784
|
Language,
|
|
9859
9785
|
FunctionResponseScheduling,
|
|
9860
9786
|
Type,
|
|
9861
|
-
Mode,
|
|
9862
9787
|
ApiSpec,
|
|
9863
9788
|
AuthType,
|
|
9864
9789
|
HttpElementLocation,
|
|
9865
9790
|
PhishBlockThreshold,
|
|
9791
|
+
Behavior,
|
|
9792
|
+
DynamicRetrievalConfigMode,
|
|
9793
|
+
FunctionCallingConfigMode,
|
|
9866
9794
|
ThinkingLevel,
|
|
9867
9795
|
HarmCategory,
|
|
9868
9796
|
HarmBlockMethod,
|
|
@@ -9881,10 +9809,7 @@ declare namespace types {
|
|
|
9881
9809
|
TuningTask,
|
|
9882
9810
|
PartMediaResolutionLevel,
|
|
9883
9811
|
FeatureSelectionPreference,
|
|
9884
|
-
Behavior,
|
|
9885
|
-
DynamicRetrievalConfigMode,
|
|
9886
9812
|
Environment,
|
|
9887
|
-
FunctionCallingConfigMode,
|
|
9888
9813
|
SafetyFilterLevel,
|
|
9889
9814
|
PersonGeneration,
|
|
9890
9815
|
ImagePromptLanguage,
|
|
@@ -9927,9 +9852,6 @@ declare namespace types {
|
|
|
9927
9852
|
HttpOptions,
|
|
9928
9853
|
Schema,
|
|
9929
9854
|
ModelSelectionConfig,
|
|
9930
|
-
FunctionDeclaration,
|
|
9931
|
-
DynamicRetrievalConfig,
|
|
9932
|
-
GoogleSearchRetrieval,
|
|
9933
9855
|
ComputerUse,
|
|
9934
9856
|
FileSearch,
|
|
9935
9857
|
ApiAuthApiKeyConfig,
|
|
@@ -9956,14 +9878,17 @@ declare namespace types {
|
|
|
9956
9878
|
Retrieval,
|
|
9957
9879
|
ToolCodeExecution,
|
|
9958
9880
|
EnterpriseWebSearch,
|
|
9881
|
+
FunctionDeclaration,
|
|
9959
9882
|
GoogleMaps,
|
|
9960
9883
|
Interval,
|
|
9961
9884
|
GoogleSearch,
|
|
9885
|
+
DynamicRetrievalConfig,
|
|
9886
|
+
GoogleSearchRetrieval,
|
|
9962
9887
|
UrlContext,
|
|
9963
9888
|
Tool,
|
|
9964
|
-
FunctionCallingConfig,
|
|
9965
9889
|
LatLng,
|
|
9966
9890
|
RetrievalConfig,
|
|
9891
|
+
FunctionCallingConfig,
|
|
9967
9892
|
ToolConfig,
|
|
9968
9893
|
ReplicatedVoiceConfig,
|
|
9969
9894
|
PrebuiltVoiceConfig,
|
|
@@ -10585,9 +10510,6 @@ declare interface URLContextCallArguments {
|
|
|
10585
10510
|
* URL context content.
|
|
10586
10511
|
*/
|
|
10587
10512
|
declare interface URLContextCallContent {
|
|
10588
|
-
/**
|
|
10589
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10590
|
-
*/
|
|
10591
10513
|
type: 'url_context_call';
|
|
10592
10514
|
/**
|
|
10593
10515
|
* A unique ID for this specific tool call.
|
|
@@ -10623,9 +10545,6 @@ declare interface URLContextResult {
|
|
|
10623
10545
|
* URL context result content.
|
|
10624
10546
|
*/
|
|
10625
10547
|
declare interface URLContextResultContent {
|
|
10626
|
-
/**
|
|
10627
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10628
|
-
*/
|
|
10629
10548
|
type: 'url_context_result';
|
|
10630
10549
|
/**
|
|
10631
10550
|
* ID to match the ID from the url context call block.
|
|
@@ -10712,7 +10631,7 @@ declare interface Usage {
|
|
|
10712
10631
|
/**
|
|
10713
10632
|
* Number of tokens of thoughts for thinking models.
|
|
10714
10633
|
*/
|
|
10715
|
-
|
|
10634
|
+
total_thought_tokens?: number;
|
|
10716
10635
|
/**
|
|
10717
10636
|
* Total token count for the interaction request (prompt + responses + other
|
|
10718
10637
|
* internal tokens).
|
|
@@ -10917,9 +10836,6 @@ export declare enum VideoCompressionQuality {
|
|
|
10917
10836
|
* A video content block.
|
|
10918
10837
|
*/
|
|
10919
10838
|
declare interface VideoContent {
|
|
10920
|
-
/**
|
|
10921
|
-
* Used as the OpenAPI type discriminator for the content oneof.
|
|
10922
|
-
*/
|
|
10923
10839
|
type: 'video';
|
|
10924
10840
|
data?: string;
|
|
10925
10841
|
/**
|
|
@@ -10929,7 +10845,7 @@ declare interface VideoContent {
|
|
|
10929
10845
|
/**
|
|
10930
10846
|
* The resolution of the media.
|
|
10931
10847
|
*/
|
|
10932
|
-
resolution?: 'low' | 'medium' | 'high';
|
|
10848
|
+
resolution?: 'low' | 'medium' | 'high' | 'ultra_high';
|
|
10933
10849
|
uri?: string;
|
|
10934
10850
|
}
|
|
10935
10851
|
|