@google/genai 1.41.0 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/genai.d.ts +335 -170
- package/dist/index.cjs +399 -110
- package/dist/index.mjs +400 -111
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +399 -110
- package/dist/node/index.mjs +400 -111
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/node.d.ts +335 -170
- package/dist/tokenizer/node.cjs +60 -32
- package/dist/tokenizer/node.d.ts +48 -3
- package/dist/tokenizer/node.mjs +60 -32
- package/dist/tokenizer/node.mjs.map +1 -1
- package/dist/web/index.mjs +400 -111
- package/dist/web/index.mjs.map +1 -1
- package/dist/web/web.d.ts +335 -170
- package/package.json +2 -2
package/dist/genai.d.ts
CHANGED
|
@@ -411,18 +411,13 @@ declare interface AudioContent {
|
|
|
411
411
|
/**
|
|
412
412
|
* The mime type of the audio.
|
|
413
413
|
*/
|
|
414
|
-
mime_type?:
|
|
414
|
+
mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac';
|
|
415
415
|
/**
|
|
416
416
|
* The URI of the audio.
|
|
417
417
|
*/
|
|
418
418
|
uri?: string;
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
/**
|
|
422
|
-
* The mime type of the audio.
|
|
423
|
-
*/
|
|
424
|
-
declare type AudioMimeType = 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac' | (string & {});
|
|
425
|
-
|
|
426
421
|
/** The audio transcription configuration in Setup. */
|
|
427
422
|
export declare interface AudioTranscriptionConfig {
|
|
428
423
|
}
|
|
@@ -1336,10 +1331,12 @@ export declare interface Candidate {
|
|
|
1336
1331
|
If empty, the model has not stopped generating the tokens.
|
|
1337
1332
|
*/
|
|
1338
1333
|
finishReason?: FinishReason;
|
|
1334
|
+
/** Output only. Metadata returned when grounding is enabled. It
|
|
1335
|
+
contains the sources used to ground the generated content.
|
|
1336
|
+
*/
|
|
1337
|
+
groundingMetadata?: GroundingMetadata;
|
|
1339
1338
|
/** Output only. Average log probability score of the candidate. */
|
|
1340
1339
|
avgLogprobs?: number;
|
|
1341
|
-
/** Output only. Metadata specifies sources used to ground generated content. */
|
|
1342
|
-
groundingMetadata?: GroundingMetadata;
|
|
1343
1340
|
/** Output only. Index of the candidate. */
|
|
1344
1341
|
index?: number;
|
|
1345
1342
|
/** Output only. Log-likelihood scores for the response tokens and top tokens */
|
|
@@ -1603,15 +1600,15 @@ declare interface CodeExecutionCallArguments {
|
|
|
1603
1600
|
* Code execution content.
|
|
1604
1601
|
*/
|
|
1605
1602
|
declare interface CodeExecutionCallContent {
|
|
1606
|
-
type: 'code_execution_call';
|
|
1607
1603
|
/**
|
|
1608
1604
|
* A unique ID for this specific tool call.
|
|
1609
1605
|
*/
|
|
1610
|
-
id
|
|
1606
|
+
id: string;
|
|
1611
1607
|
/**
|
|
1612
1608
|
* The arguments to pass to the code execution.
|
|
1613
1609
|
*/
|
|
1614
|
-
arguments
|
|
1610
|
+
arguments: CodeExecutionCallArguments;
|
|
1611
|
+
type: 'code_execution_call';
|
|
1615
1612
|
}
|
|
1616
1613
|
|
|
1617
1614
|
/** Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. */
|
|
@@ -1626,19 +1623,19 @@ export declare interface CodeExecutionResult {
|
|
|
1626
1623
|
* Code execution result content.
|
|
1627
1624
|
*/
|
|
1628
1625
|
declare interface CodeExecutionResultContent {
|
|
1629
|
-
type: 'code_execution_result';
|
|
1630
1626
|
/**
|
|
1631
1627
|
* ID to match the ID from the code execution call block.
|
|
1632
1628
|
*/
|
|
1633
|
-
call_id
|
|
1629
|
+
call_id: string;
|
|
1634
1630
|
/**
|
|
1635
|
-
*
|
|
1631
|
+
* The output of the code execution.
|
|
1636
1632
|
*/
|
|
1637
|
-
|
|
1633
|
+
result: string;
|
|
1634
|
+
type: 'code_execution_result';
|
|
1638
1635
|
/**
|
|
1639
|
-
*
|
|
1636
|
+
* Whether the code execution resulted in an error.
|
|
1640
1637
|
*/
|
|
1641
|
-
|
|
1638
|
+
is_error?: boolean;
|
|
1642
1639
|
/**
|
|
1643
1640
|
* A signature hash for backend validation.
|
|
1644
1641
|
*/
|
|
@@ -1730,31 +1727,28 @@ export declare interface Content {
|
|
|
1730
1727
|
declare type Content_2 = TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
1731
1728
|
|
|
1732
1729
|
declare interface ContentDelta {
|
|
1733
|
-
delta
|
|
1730
|
+
delta: ContentDelta.TextDelta | ContentDelta.ImageDelta | ContentDelta.AudioDelta | ContentDelta.DocumentDelta | ContentDelta.VideoDelta | ContentDelta.ThoughtSummaryDelta | ContentDelta.ThoughtSignatureDelta | ContentDelta.FunctionCallDelta | ContentDelta.FunctionResultDelta | ContentDelta.CodeExecutionCallDelta | ContentDelta.CodeExecutionResultDelta | ContentDelta.URLContextCallDelta | ContentDelta.URLContextResultDelta | ContentDelta.GoogleSearchCallDelta | ContentDelta.GoogleSearchResultDelta | ContentDelta.MCPServerToolCallDelta | ContentDelta.MCPServerToolResultDelta | ContentDelta.FileSearchCallDelta | ContentDelta.FileSearchResultDelta;
|
|
1731
|
+
event_type: 'content.delta';
|
|
1732
|
+
index: number;
|
|
1734
1733
|
/**
|
|
1735
1734
|
* The event_id token to be used to resume the interaction stream, from this event.
|
|
1736
1735
|
*/
|
|
1737
1736
|
event_id?: string;
|
|
1738
|
-
event_type?: 'content.delta';
|
|
1739
|
-
index?: number;
|
|
1740
1737
|
}
|
|
1741
1738
|
|
|
1742
1739
|
declare namespace ContentDelta {
|
|
1743
1740
|
interface TextDelta {
|
|
1741
|
+
text: string;
|
|
1744
1742
|
type: 'text';
|
|
1745
1743
|
/**
|
|
1746
1744
|
* Citation information for model-generated content.
|
|
1747
1745
|
*/
|
|
1748
1746
|
annotations?: Array<InteractionsAPI.Annotation>;
|
|
1749
|
-
text?: string;
|
|
1750
1747
|
}
|
|
1751
1748
|
interface ImageDelta {
|
|
1752
1749
|
type: 'image';
|
|
1753
1750
|
data?: string;
|
|
1754
|
-
|
|
1755
|
-
* The mime type of the image.
|
|
1756
|
-
*/
|
|
1757
|
-
mime_type?: InteractionsAPI.ImageMimeType;
|
|
1751
|
+
mime_type?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/heic' | 'image/heif';
|
|
1758
1752
|
/**
|
|
1759
1753
|
* The resolution of the media.
|
|
1760
1754
|
*/
|
|
@@ -1764,28 +1758,19 @@ declare namespace ContentDelta {
|
|
|
1764
1758
|
interface AudioDelta {
|
|
1765
1759
|
type: 'audio';
|
|
1766
1760
|
data?: string;
|
|
1767
|
-
|
|
1768
|
-
* The mime type of the audio.
|
|
1769
|
-
*/
|
|
1770
|
-
mime_type?: InteractionsAPI.AudioMimeType;
|
|
1761
|
+
mime_type?: 'audio/wav' | 'audio/mp3' | 'audio/aiff' | 'audio/aac' | 'audio/ogg' | 'audio/flac';
|
|
1771
1762
|
uri?: string;
|
|
1772
1763
|
}
|
|
1773
1764
|
interface DocumentDelta {
|
|
1774
1765
|
type: 'document';
|
|
1775
1766
|
data?: string;
|
|
1776
|
-
|
|
1777
|
-
* The mime type of the document.
|
|
1778
|
-
*/
|
|
1779
|
-
mime_type?: InteractionsAPI.DocumentMimeType;
|
|
1767
|
+
mime_type?: 'application/pdf';
|
|
1780
1768
|
uri?: string;
|
|
1781
1769
|
}
|
|
1782
1770
|
interface VideoDelta {
|
|
1783
1771
|
type: 'video';
|
|
1784
1772
|
data?: string;
|
|
1785
|
-
|
|
1786
|
-
* The mime type of the video.
|
|
1787
|
-
*/
|
|
1788
|
-
mime_type?: InteractionsAPI.VideoMimeType;
|
|
1773
|
+
mime_type?: 'video/mp4' | 'video/mpeg' | 'video/mpg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/webm' | 'video/wmv' | 'video/3gpp';
|
|
1789
1774
|
/**
|
|
1790
1775
|
* The resolution of the media.
|
|
1791
1776
|
*/
|
|
@@ -1807,28 +1792,28 @@ declare namespace ContentDelta {
|
|
|
1807
1792
|
signature?: string;
|
|
1808
1793
|
}
|
|
1809
1794
|
interface FunctionCallDelta {
|
|
1810
|
-
type: 'function_call';
|
|
1811
1795
|
/**
|
|
1812
1796
|
* A unique ID for this specific tool call.
|
|
1813
1797
|
*/
|
|
1814
|
-
id
|
|
1815
|
-
arguments
|
|
1798
|
+
id: string;
|
|
1799
|
+
arguments: {
|
|
1816
1800
|
[key: string]: unknown;
|
|
1817
1801
|
};
|
|
1818
|
-
name
|
|
1802
|
+
name: string;
|
|
1803
|
+
type: 'function_call';
|
|
1819
1804
|
}
|
|
1820
1805
|
interface FunctionResultDelta {
|
|
1821
|
-
type: 'function_result';
|
|
1822
1806
|
/**
|
|
1823
1807
|
* ID to match the ID from the function call block.
|
|
1824
1808
|
*/
|
|
1825
|
-
call_id
|
|
1826
|
-
is_error?: boolean;
|
|
1827
|
-
name?: string;
|
|
1809
|
+
call_id: string;
|
|
1828
1810
|
/**
|
|
1829
1811
|
* Tool call result delta.
|
|
1830
1812
|
*/
|
|
1831
|
-
result
|
|
1813
|
+
result: FunctionResultDelta.Items | unknown | string;
|
|
1814
|
+
type: 'function_result';
|
|
1815
|
+
is_error?: boolean;
|
|
1816
|
+
name?: string;
|
|
1832
1817
|
}
|
|
1833
1818
|
namespace FunctionResultDelta {
|
|
1834
1819
|
interface Items {
|
|
@@ -1836,91 +1821,91 @@ declare namespace ContentDelta {
|
|
|
1836
1821
|
}
|
|
1837
1822
|
}
|
|
1838
1823
|
interface CodeExecutionCallDelta {
|
|
1839
|
-
type: 'code_execution_call';
|
|
1840
1824
|
/**
|
|
1841
1825
|
* A unique ID for this specific tool call.
|
|
1842
1826
|
*/
|
|
1843
|
-
id
|
|
1827
|
+
id: string;
|
|
1844
1828
|
/**
|
|
1845
1829
|
* The arguments to pass to the code execution.
|
|
1846
1830
|
*/
|
|
1847
|
-
arguments
|
|
1831
|
+
arguments: InteractionsAPI.CodeExecutionCallArguments;
|
|
1832
|
+
type: 'code_execution_call';
|
|
1848
1833
|
}
|
|
1849
1834
|
interface CodeExecutionResultDelta {
|
|
1850
|
-
type: 'code_execution_result';
|
|
1851
1835
|
/**
|
|
1852
1836
|
* ID to match the ID from the function call block.
|
|
1853
1837
|
*/
|
|
1854
|
-
call_id
|
|
1838
|
+
call_id: string;
|
|
1839
|
+
result: string;
|
|
1840
|
+
type: 'code_execution_result';
|
|
1855
1841
|
is_error?: boolean;
|
|
1856
|
-
result?: string;
|
|
1857
1842
|
signature?: string;
|
|
1858
1843
|
}
|
|
1859
1844
|
interface URLContextCallDelta {
|
|
1860
|
-
type: 'url_context_call';
|
|
1861
1845
|
/**
|
|
1862
1846
|
* A unique ID for this specific tool call.
|
|
1863
1847
|
*/
|
|
1864
|
-
id
|
|
1848
|
+
id: string;
|
|
1865
1849
|
/**
|
|
1866
1850
|
* The arguments to pass to the URL context.
|
|
1867
1851
|
*/
|
|
1868
|
-
arguments
|
|
1852
|
+
arguments: InteractionsAPI.URLContextCallArguments;
|
|
1853
|
+
type: 'url_context_call';
|
|
1869
1854
|
}
|
|
1870
1855
|
interface URLContextResultDelta {
|
|
1871
|
-
type: 'url_context_result';
|
|
1872
1856
|
/**
|
|
1873
1857
|
* ID to match the ID from the function call block.
|
|
1874
1858
|
*/
|
|
1875
|
-
call_id
|
|
1859
|
+
call_id: string;
|
|
1860
|
+
result: Array<InteractionsAPI.URLContextResult>;
|
|
1861
|
+
type: 'url_context_result';
|
|
1876
1862
|
is_error?: boolean;
|
|
1877
|
-
result?: Array<InteractionsAPI.URLContextResult>;
|
|
1878
1863
|
signature?: string;
|
|
1879
1864
|
}
|
|
1880
1865
|
interface GoogleSearchCallDelta {
|
|
1881
|
-
type: 'google_search_call';
|
|
1882
1866
|
/**
|
|
1883
1867
|
* A unique ID for this specific tool call.
|
|
1884
1868
|
*/
|
|
1885
|
-
id
|
|
1869
|
+
id: string;
|
|
1886
1870
|
/**
|
|
1887
1871
|
* The arguments to pass to Google Search.
|
|
1888
1872
|
*/
|
|
1889
|
-
arguments
|
|
1873
|
+
arguments: InteractionsAPI.GoogleSearchCallArguments;
|
|
1874
|
+
type: 'google_search_call';
|
|
1890
1875
|
}
|
|
1891
1876
|
interface GoogleSearchResultDelta {
|
|
1892
|
-
type: 'google_search_result';
|
|
1893
1877
|
/**
|
|
1894
1878
|
* ID to match the ID from the function call block.
|
|
1895
1879
|
*/
|
|
1896
|
-
call_id
|
|
1880
|
+
call_id: string;
|
|
1881
|
+
result: Array<InteractionsAPI.GoogleSearchResult>;
|
|
1882
|
+
type: 'google_search_result';
|
|
1897
1883
|
is_error?: boolean;
|
|
1898
|
-
result?: Array<InteractionsAPI.GoogleSearchResult>;
|
|
1899
1884
|
signature?: string;
|
|
1900
1885
|
}
|
|
1901
1886
|
interface MCPServerToolCallDelta {
|
|
1902
|
-
type: 'mcp_server_tool_call';
|
|
1903
1887
|
/**
|
|
1904
1888
|
* A unique ID for this specific tool call.
|
|
1905
1889
|
*/
|
|
1906
|
-
id
|
|
1907
|
-
arguments
|
|
1890
|
+
id: string;
|
|
1891
|
+
arguments: {
|
|
1908
1892
|
[key: string]: unknown;
|
|
1909
1893
|
};
|
|
1910
|
-
name
|
|
1911
|
-
server_name
|
|
1894
|
+
name: string;
|
|
1895
|
+
server_name: string;
|
|
1896
|
+
type: 'mcp_server_tool_call';
|
|
1912
1897
|
}
|
|
1913
1898
|
interface MCPServerToolResultDelta {
|
|
1914
|
-
type: 'mcp_server_tool_result';
|
|
1915
1899
|
/**
|
|
1916
1900
|
* ID to match the ID from the function call block.
|
|
1917
1901
|
*/
|
|
1918
|
-
call_id
|
|
1919
|
-
name?: string;
|
|
1902
|
+
call_id: string;
|
|
1920
1903
|
/**
|
|
1921
1904
|
* Tool call result delta.
|
|
1922
1905
|
*/
|
|
1923
|
-
result
|
|
1906
|
+
result: MCPServerToolResultDelta.Items | unknown | string;
|
|
1907
|
+
type: 'mcp_server_tool_result';
|
|
1908
|
+
name?: string;
|
|
1924
1909
|
server_name?: string;
|
|
1925
1910
|
}
|
|
1926
1911
|
namespace MCPServerToolResultDelta {
|
|
@@ -1929,11 +1914,11 @@ declare namespace ContentDelta {
|
|
|
1929
1914
|
}
|
|
1930
1915
|
}
|
|
1931
1916
|
interface FileSearchCallDelta {
|
|
1932
|
-
type: 'file_search_call';
|
|
1933
1917
|
/**
|
|
1934
1918
|
* A unique ID for this specific tool call.
|
|
1935
1919
|
*/
|
|
1936
|
-
id
|
|
1920
|
+
id: string;
|
|
1921
|
+
type: 'file_search_call';
|
|
1937
1922
|
}
|
|
1938
1923
|
interface FileSearchResultDelta {
|
|
1939
1924
|
type: 'file_search_result';
|
|
@@ -2004,22 +1989,22 @@ declare interface ContentStart {
|
|
|
2004
1989
|
/**
|
|
2005
1990
|
* The content of the response.
|
|
2006
1991
|
*/
|
|
2007
|
-
content
|
|
1992
|
+
content: Content_2;
|
|
1993
|
+
event_type: 'content.start';
|
|
1994
|
+
index: number;
|
|
2008
1995
|
/**
|
|
2009
1996
|
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2010
1997
|
*/
|
|
2011
1998
|
event_id?: string;
|
|
2012
|
-
event_type?: 'content.start';
|
|
2013
|
-
index?: number;
|
|
2014
1999
|
}
|
|
2015
2000
|
|
|
2016
2001
|
declare interface ContentStop {
|
|
2002
|
+
event_type: 'content.stop';
|
|
2003
|
+
index: number;
|
|
2017
2004
|
/**
|
|
2018
2005
|
* The event_id token to be used to resume the interaction stream, from this event.
|
|
2019
2006
|
*/
|
|
2020
2007
|
event_id?: string;
|
|
2021
|
-
event_type?: 'content.stop';
|
|
2022
|
-
index?: number;
|
|
2023
2008
|
}
|
|
2024
2009
|
|
|
2025
2010
|
export declare type ContentUnion = Content | PartUnion[] | PartUnion;
|
|
@@ -2582,11 +2567,11 @@ export declare interface DatasetStats {
|
|
|
2582
2567
|
* Configuration for the Deep Research agent.
|
|
2583
2568
|
*/
|
|
2584
2569
|
declare interface DeepResearchAgentConfig {
|
|
2570
|
+
type: 'deep-research';
|
|
2585
2571
|
/**
|
|
2586
2572
|
* Whether to include thought summaries in the response.
|
|
2587
2573
|
*/
|
|
2588
2574
|
thinking_summaries?: 'auto' | 'none';
|
|
2589
|
-
type?: 'deep-research';
|
|
2590
2575
|
}
|
|
2591
2576
|
|
|
2592
2577
|
/** Optional parameters for models.get method. */
|
|
@@ -2825,18 +2810,13 @@ declare interface DocumentContent {
|
|
|
2825
2810
|
/**
|
|
2826
2811
|
* The mime type of the document.
|
|
2827
2812
|
*/
|
|
2828
|
-
mime_type?:
|
|
2813
|
+
mime_type?: 'application/pdf';
|
|
2829
2814
|
/**
|
|
2830
2815
|
* The URI of the document.
|
|
2831
2816
|
*/
|
|
2832
2817
|
uri?: string;
|
|
2833
2818
|
}
|
|
2834
2819
|
|
|
2835
|
-
/**
|
|
2836
|
-
* The mime type of the document.
|
|
2837
|
-
*/
|
|
2838
|
-
declare type DocumentMimeType = (string & {}) | 'application/pdf';
|
|
2839
|
-
|
|
2840
2820
|
declare class Documents extends BaseModule {
|
|
2841
2821
|
private readonly apiClient;
|
|
2842
2822
|
constructor(apiClient: ApiClient);
|
|
@@ -2922,7 +2902,7 @@ export declare interface DownloadFileParameters {
|
|
|
2922
2902
|
* Configuration for dynamic agents.
|
|
2923
2903
|
*/
|
|
2924
2904
|
declare interface DynamicAgentConfig {
|
|
2925
|
-
type
|
|
2905
|
+
type: 'dynamic';
|
|
2926
2906
|
[k: string]: unknown;
|
|
2927
2907
|
}
|
|
2928
2908
|
|
|
@@ -3098,6 +3078,25 @@ export declare interface EmbedContentParameters {
|
|
|
3098
3078
|
config?: EmbedContentConfig;
|
|
3099
3079
|
}
|
|
3100
3080
|
|
|
3081
|
+
/** Parameters for the _embed_content method. */
|
|
3082
|
+
export declare interface EmbedContentParametersPrivate {
|
|
3083
|
+
/** ID of the model to use. For a list of models, see `Google models
|
|
3084
|
+
<https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models>`_. */
|
|
3085
|
+
model: string;
|
|
3086
|
+
/** The content to embed. Only the `parts.text` fields will be counted.
|
|
3087
|
+
*/
|
|
3088
|
+
contents?: ContentListUnion;
|
|
3089
|
+
/** The single content to embed. Only the `parts.text` fields will be counted.
|
|
3090
|
+
*/
|
|
3091
|
+
content?: ContentUnion;
|
|
3092
|
+
/** The Vertex embedding API to use.
|
|
3093
|
+
*/
|
|
3094
|
+
embeddingApiType?: EmbeddingApiType;
|
|
3095
|
+
/** Configuration that contains optional parameters.
|
|
3096
|
+
*/
|
|
3097
|
+
config?: EmbedContentConfig;
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3101
3100
|
/** Response for the embed_content method. */
|
|
3102
3101
|
export declare class EmbedContentResponse {
|
|
3103
3102
|
/** Used to retain the full HTTP response. */
|
|
@@ -3111,6 +3110,18 @@ export declare class EmbedContentResponse {
|
|
|
3111
3110
|
metadata?: EmbedContentMetadata;
|
|
3112
3111
|
}
|
|
3113
3112
|
|
|
3113
|
+
/** Enum representing the Vertex embedding API to use. */
|
|
3114
|
+
export declare enum EmbeddingApiType {
|
|
3115
|
+
/**
|
|
3116
|
+
* predict API endpoint (default)
|
|
3117
|
+
*/
|
|
3118
|
+
PREDICT = "PREDICT",
|
|
3119
|
+
/**
|
|
3120
|
+
* embedContent API Endpoint
|
|
3121
|
+
*/
|
|
3122
|
+
EMBED_CONTENT = "EMBED_CONTENT"
|
|
3123
|
+
}
|
|
3124
|
+
|
|
3114
3125
|
export declare interface EmbeddingsBatchJobSource {
|
|
3115
3126
|
/** The Gemini Developer API's file resource name of the input data
|
|
3116
3127
|
(e.g. "files/12345").
|
|
@@ -3180,6 +3191,7 @@ export declare enum Environment {
|
|
|
3180
3191
|
}
|
|
3181
3192
|
|
|
3182
3193
|
declare interface ErrorEvent_2 {
|
|
3194
|
+
event_type: 'error';
|
|
3183
3195
|
/**
|
|
3184
3196
|
* Error message from an interaction.
|
|
3185
3197
|
*/
|
|
@@ -3188,7 +3200,6 @@ declare interface ErrorEvent_2 {
|
|
|
3188
3200
|
* The event_id token to be used to resume the interaction stream, from this event.
|
|
3189
3201
|
*/
|
|
3190
3202
|
event_id?: string;
|
|
3191
|
-
event_type?: 'error';
|
|
3192
3203
|
}
|
|
3193
3204
|
|
|
3194
3205
|
declare namespace ErrorEvent_2 {
|
|
@@ -3480,17 +3491,21 @@ export declare interface FileSearch {
|
|
|
3480
3491
|
* File Search content.
|
|
3481
3492
|
*/
|
|
3482
3493
|
declare interface FileSearchCallContent {
|
|
3483
|
-
type: 'file_search_call';
|
|
3484
3494
|
/**
|
|
3485
3495
|
* A unique ID for this specific tool call.
|
|
3486
3496
|
*/
|
|
3487
|
-
id
|
|
3497
|
+
id: string;
|
|
3498
|
+
type: 'file_search_call';
|
|
3488
3499
|
}
|
|
3489
3500
|
|
|
3490
3501
|
/**
|
|
3491
3502
|
* File Search result content.
|
|
3492
3503
|
*/
|
|
3493
3504
|
declare interface FileSearchResultContent {
|
|
3505
|
+
/**
|
|
3506
|
+
* ID to match the ID from the file search call block.
|
|
3507
|
+
*/
|
|
3508
|
+
call_id: string;
|
|
3494
3509
|
type: 'file_search_result';
|
|
3495
3510
|
/**
|
|
3496
3511
|
* The results of the File Search.
|
|
@@ -4687,7 +4702,7 @@ declare interface GenerationConfig_2 {
|
|
|
4687
4702
|
/**
|
|
4688
4703
|
* The tool choice for the interaction.
|
|
4689
4704
|
*/
|
|
4690
|
-
tool_choice?:
|
|
4705
|
+
tool_choice?: ToolChoiceType | ToolChoiceConfig;
|
|
4691
4706
|
/**
|
|
4692
4707
|
* The maximum cumulative probability of tokens to consider when sampling.
|
|
4693
4708
|
*/
|
|
@@ -5025,8 +5040,10 @@ export declare interface GoogleRpcStatus {
|
|
|
5025
5040
|
message?: string;
|
|
5026
5041
|
}
|
|
5027
5042
|
|
|
5028
|
-
/**
|
|
5043
|
+
/** Tool to support web search. */
|
|
5029
5044
|
export declare interface GoogleSearch {
|
|
5045
|
+
/** Different types of search that can be enabled on the GoogleSearch tool. */
|
|
5046
|
+
searchTypes?: SearchTypes;
|
|
5030
5047
|
/** Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API. */
|
|
5031
5048
|
excludeDomains?: string[];
|
|
5032
5049
|
/** Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API. */
|
|
@@ -5049,15 +5066,19 @@ declare interface GoogleSearchCallArguments {
|
|
|
5049
5066
|
* Google Search content.
|
|
5050
5067
|
*/
|
|
5051
5068
|
declare interface GoogleSearchCallContent {
|
|
5052
|
-
type: 'google_search_call';
|
|
5053
5069
|
/**
|
|
5054
5070
|
* A unique ID for this specific tool call.
|
|
5055
5071
|
*/
|
|
5056
|
-
id
|
|
5072
|
+
id: string;
|
|
5057
5073
|
/**
|
|
5058
5074
|
* The arguments to pass to Google Search.
|
|
5059
5075
|
*/
|
|
5060
|
-
arguments
|
|
5076
|
+
arguments: GoogleSearchCallArguments;
|
|
5077
|
+
type: 'google_search_call';
|
|
5078
|
+
/**
|
|
5079
|
+
* The type of search grounding enabled.
|
|
5080
|
+
*/
|
|
5081
|
+
search_type?: 'web_search' | 'image_search';
|
|
5061
5082
|
}
|
|
5062
5083
|
|
|
5063
5084
|
/**
|
|
@@ -5082,19 +5103,19 @@ declare interface GoogleSearchResult {
|
|
|
5082
5103
|
* Google Search result content.
|
|
5083
5104
|
*/
|
|
5084
5105
|
declare interface GoogleSearchResultContent {
|
|
5085
|
-
type: 'google_search_result';
|
|
5086
5106
|
/**
|
|
5087
5107
|
* ID to match the ID from the google search call block.
|
|
5088
5108
|
*/
|
|
5089
|
-
call_id
|
|
5109
|
+
call_id: string;
|
|
5090
5110
|
/**
|
|
5091
|
-
*
|
|
5111
|
+
* The results of the Google Search.
|
|
5092
5112
|
*/
|
|
5093
|
-
|
|
5113
|
+
result: Array<GoogleSearchResult>;
|
|
5114
|
+
type: 'google_search_result';
|
|
5094
5115
|
/**
|
|
5095
|
-
*
|
|
5116
|
+
* Whether the Google Search resulted in an error.
|
|
5096
5117
|
*/
|
|
5097
|
-
|
|
5118
|
+
is_error?: boolean;
|
|
5098
5119
|
/**
|
|
5099
5120
|
* The signature of the Google Search result.
|
|
5100
5121
|
*/
|
|
@@ -5117,8 +5138,16 @@ export declare interface GoogleTypeDate {
|
|
|
5117
5138
|
year?: number;
|
|
5118
5139
|
}
|
|
5119
5140
|
|
|
5120
|
-
/**
|
|
5141
|
+
/** A piece of evidence that supports a claim made by the model.
|
|
5142
|
+
|
|
5143
|
+
This is used to show a citation for a claim made by the model. When grounding
|
|
5144
|
+
is enabled, the model returns a `GroundingChunk` that contains a reference to
|
|
5145
|
+
the source of the information. */
|
|
5121
5146
|
export declare interface GroundingChunk {
|
|
5147
|
+
/** A grounding chunk from an image search result. See the `Image`
|
|
5148
|
+
message for details.
|
|
5149
|
+
*/
|
|
5150
|
+
image?: GroundingChunkImage;
|
|
5122
5151
|
/** Grounding chunk from Google Maps. This field is not supported in Gemini API. */
|
|
5123
5152
|
maps?: GroundingChunkMaps;
|
|
5124
5153
|
/** Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API. */
|
|
@@ -5127,6 +5156,22 @@ export declare interface GroundingChunk {
|
|
|
5127
5156
|
web?: GroundingChunkWeb;
|
|
5128
5157
|
}
|
|
5129
5158
|
|
|
5159
|
+
/** A piece of evidence that comes from an image search result.
|
|
5160
|
+
|
|
5161
|
+
It contains the URI of the image search result and the URI of the image.
|
|
5162
|
+
This is used to provide the user with a link to the source of the
|
|
5163
|
+
information. */
|
|
5164
|
+
export declare interface GroundingChunkImage {
|
|
5165
|
+
/** The URI of the image search result page. */
|
|
5166
|
+
sourceUri?: string;
|
|
5167
|
+
/** The URI of the image. */
|
|
5168
|
+
imageUri?: string;
|
|
5169
|
+
/** The title of the image search result page. */
|
|
5170
|
+
title?: string;
|
|
5171
|
+
/** The domain of the image search result page. */
|
|
5172
|
+
domain?: string;
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5130
5175
|
/** Chunk from Google Maps. This data type is not supported in Gemini API. */
|
|
5131
5176
|
export declare interface GroundingChunkMaps {
|
|
5132
5177
|
/** Sources used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as uris to flag content. */
|
|
@@ -5201,12 +5246,19 @@ export declare interface GroundingChunkWeb {
|
|
|
5201
5246
|
uri?: string;
|
|
5202
5247
|
}
|
|
5203
5248
|
|
|
5204
|
-
/** Metadata returned to client when grounding is enabled. */
|
|
5205
5249
|
export declare interface GroundingMetadata {
|
|
5250
|
+
/** Optional. The image search queries that were used to generate the
|
|
5251
|
+
content. This field is populated only when the grounding source is Google
|
|
5252
|
+
Search with the Image Search search_type enabled.
|
|
5253
|
+
*/
|
|
5254
|
+
imageSearchQueries?: string[];
|
|
5255
|
+
/** A list of supporting references retrieved from the grounding
|
|
5256
|
+
source. This field is populated when the grounding source is Google
|
|
5257
|
+
Search, Vertex AI Search, or Google Maps.
|
|
5258
|
+
*/
|
|
5259
|
+
groundingChunks?: GroundingChunk[];
|
|
5206
5260
|
/** Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding. This field is not supported in Gemini API. */
|
|
5207
5261
|
googleMapsWidgetContextToken?: string;
|
|
5208
|
-
/** List of supporting references retrieved from specified grounding source. */
|
|
5209
|
-
groundingChunks?: GroundingChunk[];
|
|
5210
5262
|
/** Optional. List of grounding support. */
|
|
5211
5263
|
groundingSupports?: GroundingSupport[];
|
|
5212
5264
|
/** Optional. Output only. Retrieval metadata. */
|
|
@@ -5530,6 +5582,12 @@ export declare interface ImageConfig {
|
|
|
5530
5582
|
/** Controls the generation of people. Supported values are:
|
|
5531
5583
|
ALLOW_ALL, ALLOW_ADULT, ALLOW_NONE. */
|
|
5532
5584
|
personGeneration?: string;
|
|
5585
|
+
/** Controls whether prominent people (celebrities)
|
|
5586
|
+
generation is allowed. If used with personGeneration, personGeneration
|
|
5587
|
+
enum would take precedence. For instance, if ALLOW_NONE is set, all person
|
|
5588
|
+
generation would be blocked. If this field is unspecified, the default
|
|
5589
|
+
behavior is to allow prominent people. */
|
|
5590
|
+
prominentPeople?: ProminentPeople;
|
|
5533
5591
|
/** MIME type of the generated image. This field is not
|
|
5534
5592
|
supported in Gemini API. */
|
|
5535
5593
|
outputMimeType?: string;
|
|
@@ -5542,8 +5600,8 @@ export declare interface ImageConfig {
|
|
|
5542
5600
|
* The configuration for image interaction.
|
|
5543
5601
|
*/
|
|
5544
5602
|
declare interface ImageConfig_2 {
|
|
5545
|
-
aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9';
|
|
5546
|
-
image_size?: '1K' | '2K' | '4K';
|
|
5603
|
+
aspect_ratio?: '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' | '1:8' | '8:1' | '1:4' | '4:1';
|
|
5604
|
+
image_size?: '1K' | '2K' | '4K' | '512';
|
|
5547
5605
|
}
|
|
5548
5606
|
|
|
5549
5607
|
/**
|
|
@@ -5558,7 +5616,7 @@ declare interface ImageContent {
|
|
|
5558
5616
|
/**
|
|
5559
5617
|
* The mime type of the image.
|
|
5560
5618
|
*/
|
|
5561
|
-
mime_type?:
|
|
5619
|
+
mime_type?: 'image/png' | 'image/jpeg' | 'image/webp' | 'image/heic' | 'image/heif';
|
|
5562
5620
|
/**
|
|
5563
5621
|
* The resolution of the media.
|
|
5564
5622
|
*/
|
|
@@ -5569,11 +5627,6 @@ declare interface ImageContent {
|
|
|
5569
5627
|
uri?: string;
|
|
5570
5628
|
}
|
|
5571
5629
|
|
|
5572
|
-
/**
|
|
5573
|
-
* The mime type of the image.
|
|
5574
|
-
*/
|
|
5575
|
-
declare type ImageMimeType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/heic' | 'image/heif' | (string & {});
|
|
5576
|
-
|
|
5577
5630
|
/** Enum that specifies the language of the text in the prompt. */
|
|
5578
5631
|
export declare enum ImagePromptLanguage {
|
|
5579
5632
|
/**
|
|
@@ -5610,6 +5663,10 @@ export declare enum ImagePromptLanguage {
|
|
|
5610
5663
|
es = "es"
|
|
5611
5664
|
}
|
|
5612
5665
|
|
|
5666
|
+
/** Image search for grounding and related configurations. */
|
|
5667
|
+
export declare interface ImageSearch {
|
|
5668
|
+
}
|
|
5669
|
+
|
|
5613
5670
|
/** Optional parameters for importing a file. */
|
|
5614
5671
|
export declare interface ImportFileConfig {
|
|
5615
5672
|
/** Used to override HTTP request options. */
|
|
@@ -5713,19 +5770,32 @@ declare interface Interaction {
|
|
|
5713
5770
|
* Output only. A unique identifier for the interaction completion.
|
|
5714
5771
|
*/
|
|
5715
5772
|
id: string;
|
|
5773
|
+
/**
|
|
5774
|
+
* Output only. The time at which the response was created in ISO 8601 format
|
|
5775
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
5776
|
+
*/
|
|
5777
|
+
created: string;
|
|
5716
5778
|
/**
|
|
5717
5779
|
* Output only. The status of the interaction.
|
|
5718
5780
|
*/
|
|
5719
5781
|
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
5782
|
+
/**
|
|
5783
|
+
* Output only. The time at which the response was last updated in ISO 8601 format
|
|
5784
|
+
* (YYYY-MM-DDThh:mm:ssZ).
|
|
5785
|
+
*/
|
|
5786
|
+
updated: string;
|
|
5720
5787
|
/**
|
|
5721
5788
|
* The name of the `Agent` used for generating the interaction.
|
|
5722
5789
|
*/
|
|
5723
5790
|
agent?: (string & {}) | 'deep-research-pro-preview-12-2025';
|
|
5724
5791
|
/**
|
|
5725
|
-
*
|
|
5726
|
-
|
|
5792
|
+
* Configuration for the agent.
|
|
5793
|
+
*/
|
|
5794
|
+
agent_config?: DynamicAgentConfig | DeepResearchAgentConfig;
|
|
5795
|
+
/**
|
|
5796
|
+
* The inputs for the interaction.
|
|
5727
5797
|
*/
|
|
5728
|
-
|
|
5798
|
+
input?: string | Array<Content_2> | Array<Turn> | TextContent | ImageContent | AudioContent | DocumentContent | VideoContent | ThoughtContent | FunctionCallContent | FunctionResultContent | CodeExecutionCallContent | CodeExecutionResultContent | URLContextCallContent | URLContextResultContent | GoogleSearchCallContent | GoogleSearchResultContent | MCPServerToolCallContent | MCPServerToolResultContent | FileSearchCallContent | FileSearchResultContent;
|
|
5729
5799
|
/**
|
|
5730
5800
|
* The name of the `Model` used for generating the interaction.
|
|
5731
5801
|
*/
|
|
@@ -5738,15 +5808,31 @@ declare interface Interaction {
|
|
|
5738
5808
|
* The ID of the previous interaction, if any.
|
|
5739
5809
|
*/
|
|
5740
5810
|
previous_interaction_id?: string;
|
|
5811
|
+
/**
|
|
5812
|
+
* Enforces that the generated response is a JSON object that complies with
|
|
5813
|
+
* the JSON schema specified in this field.
|
|
5814
|
+
*/
|
|
5815
|
+
response_format?: unknown;
|
|
5816
|
+
/**
|
|
5817
|
+
* The mime type of the response. This is required if response_format is set.
|
|
5818
|
+
*/
|
|
5819
|
+
response_mime_type?: string;
|
|
5820
|
+
/**
|
|
5821
|
+
* The requested modalities of the response (TEXT, IMAGE, AUDIO).
|
|
5822
|
+
*/
|
|
5823
|
+
response_modalities?: Array<'text' | 'image' | 'audio'>;
|
|
5741
5824
|
/**
|
|
5742
5825
|
* Output only. The role of the interaction.
|
|
5743
5826
|
*/
|
|
5744
5827
|
role?: string;
|
|
5745
5828
|
/**
|
|
5746
|
-
*
|
|
5747
|
-
|
|
5829
|
+
* System instruction for the interaction.
|
|
5830
|
+
*/
|
|
5831
|
+
system_instruction?: string;
|
|
5832
|
+
/**
|
|
5833
|
+
* A list of tool declarations the model may call during interaction.
|
|
5748
5834
|
*/
|
|
5749
|
-
|
|
5835
|
+
tools?: Array<Tool_2>;
|
|
5750
5836
|
/**
|
|
5751
5837
|
* Output only. Statistics on the interaction request's token usage.
|
|
5752
5838
|
*/
|
|
@@ -5761,15 +5847,16 @@ declare interface InteractionCancelParams {
|
|
|
5761
5847
|
}
|
|
5762
5848
|
|
|
5763
5849
|
declare interface InteractionCompleteEvent {
|
|
5850
|
+
event_type: 'interaction.complete';
|
|
5764
5851
|
/**
|
|
5765
|
-
* The
|
|
5852
|
+
* The completed interaction with empty outputs to reduce the payload size.
|
|
5853
|
+
* Use the preceding ContentDelta events for the actual output.
|
|
5766
5854
|
*/
|
|
5767
|
-
|
|
5768
|
-
event_type?: 'interaction.complete';
|
|
5855
|
+
interaction: Interaction;
|
|
5769
5856
|
/**
|
|
5770
|
-
* The
|
|
5857
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5771
5858
|
*/
|
|
5772
|
-
|
|
5859
|
+
event_id?: string;
|
|
5773
5860
|
}
|
|
5774
5861
|
|
|
5775
5862
|
declare type InteractionCreateParams = CreateModelInteractionParamsNonStreaming | CreateModelInteractionParamsStreaming | CreateAgentInteractionParamsNonStreaming | CreateAgentInteractionParamsStreaming;
|
|
@@ -5827,7 +5914,7 @@ export declare class Interactions extends BaseInteractions {
|
|
|
5827
5914
|
}
|
|
5828
5915
|
|
|
5829
5916
|
export declare namespace Interactions {
|
|
5830
|
-
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, type
|
|
5917
|
+
export { type AllowedTools as AllowedTools, type Annotation as Annotation, type AudioContent as AudioContent, 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 DynamicAgentConfig as DynamicAgentConfig, type ErrorEvent_2 as ErrorEvent, type FileSearchCallContent as FileSearchCallContent, type FileSearchResultContent as FileSearchResultContent, type Function_2 as Function, type FunctionCallContent as FunctionCallContent, type FunctionResultContent as FunctionResultContent, type GenerationConfig_2 as GenerationConfig, type GoogleSearchCallArguments as GoogleSearchCallArguments, type GoogleSearchCallContent as GoogleSearchCallContent, type GoogleSearchResult as GoogleSearchResult, type GoogleSearchResultContent as GoogleSearchResultContent, type ImageConfig_2 as ImageConfig, type ImageContent as ImageContent, type Interaction as Interaction, type InteractionCompleteEvent as InteractionCompleteEvent, type InteractionSSEEvent as InteractionSSEEvent, type InteractionStartEvent as InteractionStartEvent, 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 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 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, };
|
|
5831
5918
|
}
|
|
5832
5919
|
|
|
5833
5920
|
declare namespace InteractionsAPI {
|
|
@@ -5837,7 +5924,6 @@ declare namespace InteractionsAPI {
|
|
|
5837
5924
|
AllowedTools,
|
|
5838
5925
|
Annotation,
|
|
5839
5926
|
AudioContent,
|
|
5840
|
-
AudioMimeType,
|
|
5841
5927
|
CodeExecutionCallArguments,
|
|
5842
5928
|
CodeExecutionCallContent,
|
|
5843
5929
|
CodeExecutionResultContent,
|
|
@@ -5847,7 +5933,6 @@ declare namespace InteractionsAPI {
|
|
|
5847
5933
|
ContentStop,
|
|
5848
5934
|
DeepResearchAgentConfig,
|
|
5849
5935
|
DocumentContent,
|
|
5850
|
-
DocumentMimeType,
|
|
5851
5936
|
DynamicAgentConfig,
|
|
5852
5937
|
ErrorEvent_2 as ErrorEvent,
|
|
5853
5938
|
FileSearchCallContent,
|
|
@@ -5862,7 +5947,6 @@ declare namespace InteractionsAPI {
|
|
|
5862
5947
|
GoogleSearchResultContent,
|
|
5863
5948
|
ImageConfig_2 as ImageConfig,
|
|
5864
5949
|
ImageContent,
|
|
5865
|
-
ImageMimeType,
|
|
5866
5950
|
Interaction,
|
|
5867
5951
|
InteractionCompleteEvent,
|
|
5868
5952
|
InteractionSSEEvent,
|
|
@@ -5876,7 +5960,6 @@ declare namespace InteractionsAPI {
|
|
|
5876
5960
|
ThinkingLevel_2 as ThinkingLevel,
|
|
5877
5961
|
ThoughtContent,
|
|
5878
5962
|
Tool_2 as Tool,
|
|
5879
|
-
ToolChoice,
|
|
5880
5963
|
ToolChoiceConfig,
|
|
5881
5964
|
ToolChoiceType,
|
|
5882
5965
|
Turn,
|
|
@@ -5886,7 +5969,6 @@ declare namespace InteractionsAPI {
|
|
|
5886
5969
|
URLContextResultContent,
|
|
5887
5970
|
Usage,
|
|
5888
5971
|
VideoContent,
|
|
5889
|
-
VideoMimeType,
|
|
5890
5972
|
InteractionDeleteResponse,
|
|
5891
5973
|
InteractionCreateParams,
|
|
5892
5974
|
BaseCreateModelInteractionParams,
|
|
@@ -5907,25 +5989,25 @@ declare namespace InteractionsAPI {
|
|
|
5907
5989
|
declare type InteractionSSEEvent = InteractionStartEvent | InteractionCompleteEvent | InteractionStatusUpdate | ContentStart | ContentDelta | ContentStop | ErrorEvent_2;
|
|
5908
5990
|
|
|
5909
5991
|
declare interface InteractionStartEvent {
|
|
5992
|
+
event_type: 'interaction.start';
|
|
5910
5993
|
/**
|
|
5911
|
-
* The
|
|
5994
|
+
* The Interaction resource.
|
|
5912
5995
|
*/
|
|
5913
|
-
|
|
5914
|
-
event_type?: 'interaction.start';
|
|
5996
|
+
interaction: Interaction;
|
|
5915
5997
|
/**
|
|
5916
|
-
* The
|
|
5998
|
+
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5917
5999
|
*/
|
|
5918
|
-
|
|
6000
|
+
event_id?: string;
|
|
5919
6001
|
}
|
|
5920
6002
|
|
|
5921
6003
|
declare interface InteractionStatusUpdate {
|
|
6004
|
+
event_type: 'interaction.status_update';
|
|
6005
|
+
interaction_id: string;
|
|
6006
|
+
status: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
5922
6007
|
/**
|
|
5923
6008
|
* The event_id token to be used to resume the interaction stream, from this event.
|
|
5924
6009
|
*/
|
|
5925
6010
|
event_id?: string;
|
|
5926
|
-
event_type?: 'interaction.status_update';
|
|
5927
|
-
interaction_id?: string;
|
|
5928
|
-
status?: 'in_progress' | 'requires_action' | 'completed' | 'failed' | 'cancelled' | 'incomplete';
|
|
5929
6011
|
}
|
|
5930
6012
|
|
|
5931
6013
|
/** Parameters for the private _Register method. */
|
|
@@ -7095,6 +7177,14 @@ export declare enum MaskReferenceMode {
|
|
|
7095
7177
|
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
7096
7178
|
}
|
|
7097
7179
|
|
|
7180
|
+
/** A MCPServer is a server that can be called by the model to perform actions. It is a server that implements the MCP protocol. Next ID: 5. This data type is not supported in Vertex AI. */
|
|
7181
|
+
export declare interface McpServer {
|
|
7182
|
+
/** The name of the MCPServer. */
|
|
7183
|
+
name?: string;
|
|
7184
|
+
/** A transport that can stream HTTP requests and responses. */
|
|
7185
|
+
streamableHttpTransport?: StreamableHttpTransport;
|
|
7186
|
+
}
|
|
7187
|
+
|
|
7098
7188
|
/**
|
|
7099
7189
|
* MCPServer tool call content.
|
|
7100
7190
|
*/
|
|
@@ -7303,7 +7393,7 @@ export declare interface Model {
|
|
|
7303
7393
|
/**
|
|
7304
7394
|
* The model that will complete your prompt.\n\nSee [models](https://ai.google.dev/gemini-api/docs/models) for additional details.
|
|
7305
7395
|
*/
|
|
7306
|
-
declare type Model_2 = 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | (string & {});
|
|
7396
|
+
declare type Model_2 = 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | (string & {});
|
|
7307
7397
|
|
|
7308
7398
|
/** Configuration for Model Armor integrations of prompt and responses. This data type is not supported in Gemini API. */
|
|
7309
7399
|
export declare interface ModelArmorConfig {
|
|
@@ -7316,6 +7406,28 @@ export declare interface ModelArmorConfig {
|
|
|
7316
7406
|
export declare class Models extends BaseModule {
|
|
7317
7407
|
private readonly apiClient;
|
|
7318
7408
|
constructor(apiClient: ApiClient);
|
|
7409
|
+
/**
|
|
7410
|
+
* Calculates embeddings for the given contents.
|
|
7411
|
+
*
|
|
7412
|
+
* @param params - The parameters for embedding contents.
|
|
7413
|
+
* @return The response from the API.
|
|
7414
|
+
*
|
|
7415
|
+
* @example
|
|
7416
|
+
* ```ts
|
|
7417
|
+
* const response = await ai.models.embedContent({
|
|
7418
|
+
* model: 'text-embedding-004',
|
|
7419
|
+
* contents: [
|
|
7420
|
+
* 'What is your name?',
|
|
7421
|
+
* 'What is your favorite color?',
|
|
7422
|
+
* ],
|
|
7423
|
+
* config: {
|
|
7424
|
+
* outputDimensionality: 64,
|
|
7425
|
+
* },
|
|
7426
|
+
* });
|
|
7427
|
+
* console.log(response);
|
|
7428
|
+
* ```
|
|
7429
|
+
*/
|
|
7430
|
+
embedContent: (params: types.EmbedContentParameters) => Promise<types.EmbedContentResponse>;
|
|
7319
7431
|
/**
|
|
7320
7432
|
* Makes an API request to generate content with a given model.
|
|
7321
7433
|
*
|
|
@@ -7526,7 +7638,7 @@ export declare class Models extends BaseModule {
|
|
|
7526
7638
|
* console.log(response);
|
|
7527
7639
|
* ```
|
|
7528
7640
|
*/
|
|
7529
|
-
|
|
7641
|
+
private embedContentInternal;
|
|
7530
7642
|
/**
|
|
7531
7643
|
* Private method for generating images.
|
|
7532
7644
|
*/
|
|
@@ -8202,6 +8314,22 @@ export declare interface ProductImage {
|
|
|
8202
8314
|
productImage?: Image_2;
|
|
8203
8315
|
}
|
|
8204
8316
|
|
|
8317
|
+
/** Enum for controlling whether the model can generate images of prominent people (celebrities). */
|
|
8318
|
+
export declare enum ProminentPeople {
|
|
8319
|
+
/**
|
|
8320
|
+
* Unspecified value. The model will proceed with the default behavior, which is to allow generation of prominent people.
|
|
8321
|
+
*/
|
|
8322
|
+
PROMINENT_PEOPLE_UNSPECIFIED = "PROMINENT_PEOPLE_UNSPECIFIED",
|
|
8323
|
+
/**
|
|
8324
|
+
* Allows the model to generate images of prominent people.
|
|
8325
|
+
*/
|
|
8326
|
+
ALLOW_PROMINENT_PEOPLE = "ALLOW_PROMINENT_PEOPLE",
|
|
8327
|
+
/**
|
|
8328
|
+
* Prevents the model from generating images of prominent people.
|
|
8329
|
+
*/
|
|
8330
|
+
BLOCK_PROMINENT_PEOPLE = "BLOCK_PROMINENT_PEOPLE"
|
|
8331
|
+
}
|
|
8332
|
+
|
|
8205
8333
|
/**
|
|
8206
8334
|
* @license
|
|
8207
8335
|
* Copyright 2025 Google LLC
|
|
@@ -8754,6 +8882,15 @@ export declare interface SearchEntryPoint {
|
|
|
8754
8882
|
sdkBlob?: string;
|
|
8755
8883
|
}
|
|
8756
8884
|
|
|
8885
|
+
/** Tool to support computer use. */
|
|
8886
|
+
export declare interface SearchTypes {
|
|
8887
|
+
/** Setting this field enables web search. Only text results are
|
|
8888
|
+
returned. */
|
|
8889
|
+
webSearch?: WebSearch;
|
|
8890
|
+
/** Setting this field enables image search. Image bytes are returned. */
|
|
8891
|
+
imageSearch?: ImageSearch;
|
|
8892
|
+
}
|
|
8893
|
+
|
|
8757
8894
|
/** Segment of the content. */
|
|
8758
8895
|
export declare interface Segment {
|
|
8759
8896
|
/** Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero. */
|
|
@@ -9116,6 +9253,20 @@ declare class Stream<Item> implements AsyncIterable<Item> {
|
|
|
9116
9253
|
toReadableStream(): _ReadableStream_2;
|
|
9117
9254
|
}
|
|
9118
9255
|
|
|
9256
|
+
/** A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not supported in Vertex AI. */
|
|
9257
|
+
export declare interface StreamableHttpTransport {
|
|
9258
|
+
/** Optional: Fields for authentication headers, timeouts, etc., if needed. */
|
|
9259
|
+
headers?: Record<string, string>;
|
|
9260
|
+
/** Timeout for SSE read operations. */
|
|
9261
|
+
sseReadTimeout?: string;
|
|
9262
|
+
/** Whether to close the client session when the transport closes. */
|
|
9263
|
+
terminateOnClose?: boolean;
|
|
9264
|
+
/** HTTP timeout for regular operations. */
|
|
9265
|
+
timeout?: string;
|
|
9266
|
+
/** The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp". */
|
|
9267
|
+
url?: string;
|
|
9268
|
+
}
|
|
9269
|
+
|
|
9119
9270
|
/** User provided string values assigned to a single metadata key. This data type is not supported in Vertex AI. */
|
|
9120
9271
|
export declare interface StringList {
|
|
9121
9272
|
/** The string values of the metadata to store. */
|
|
@@ -9301,15 +9452,15 @@ export declare interface TestTableItem {
|
|
|
9301
9452
|
* A text content block.
|
|
9302
9453
|
*/
|
|
9303
9454
|
declare interface TextContent {
|
|
9455
|
+
/**
|
|
9456
|
+
* The text content.
|
|
9457
|
+
*/
|
|
9458
|
+
text: string;
|
|
9304
9459
|
type: 'text';
|
|
9305
9460
|
/**
|
|
9306
9461
|
* Citation information for model-generated content.
|
|
9307
9462
|
*/
|
|
9308
9463
|
annotations?: Array<Annotation>;
|
|
9309
|
-
/**
|
|
9310
|
-
* The text content.
|
|
9311
|
-
*/
|
|
9312
|
-
text?: string;
|
|
9313
9464
|
}
|
|
9314
9465
|
|
|
9315
9466
|
/** The thinking features configuration. */
|
|
@@ -9475,6 +9626,8 @@ export declare interface Tool {
|
|
|
9475
9626
|
computerUse?: ComputerUse;
|
|
9476
9627
|
/** Optional. Tool to retrieve knowledge from the File Search Stores. */
|
|
9477
9628
|
fileSearch?: FileSearch;
|
|
9629
|
+
/** Enables the model to execute Google Search as part of generation. */
|
|
9630
|
+
googleSearch?: GoogleSearch;
|
|
9478
9631
|
/** Optional. CodeExecution tool type. Enables the model to execute code as part of generation. */
|
|
9479
9632
|
codeExecution?: ToolCodeExecution;
|
|
9480
9633
|
/** Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API. */
|
|
@@ -9483,12 +9636,12 @@ export declare interface Tool {
|
|
|
9483
9636
|
functionDeclarations?: FunctionDeclaration[];
|
|
9484
9637
|
/** Optional. GoogleMaps tool type. Tool to support Google Maps in Model. */
|
|
9485
9638
|
googleMaps?: GoogleMaps;
|
|
9486
|
-
/** Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. */
|
|
9487
|
-
googleSearch?: GoogleSearch;
|
|
9488
9639
|
/** Optional. Specialized retrieval tool that is powered by Google Search. */
|
|
9489
9640
|
googleSearchRetrieval?: GoogleSearchRetrieval;
|
|
9490
9641
|
/** Optional. Tool to support URL context retrieval. */
|
|
9491
9642
|
urlContext?: UrlContext;
|
|
9643
|
+
/** Optional. MCP Servers to connect to. This field is not supported in Vertex AI. */
|
|
9644
|
+
mcpServers?: McpServer[];
|
|
9492
9645
|
}
|
|
9493
9646
|
|
|
9494
9647
|
/**
|
|
@@ -9502,6 +9655,10 @@ declare namespace Tool_2 {
|
|
|
9502
9655
|
*/
|
|
9503
9656
|
interface GoogleSearch {
|
|
9504
9657
|
type: 'google_search';
|
|
9658
|
+
/**
|
|
9659
|
+
* The types of search grounding to enable.
|
|
9660
|
+
*/
|
|
9661
|
+
search_types?: Array<'web_search' | 'image_search'>;
|
|
9505
9662
|
}
|
|
9506
9663
|
/**
|
|
9507
9664
|
* A tool that can be used by the model to execute code.
|
|
@@ -9575,13 +9732,11 @@ declare namespace Tool_2 {
|
|
|
9575
9732
|
}
|
|
9576
9733
|
|
|
9577
9734
|
/**
|
|
9578
|
-
* The configuration
|
|
9735
|
+
* The tool choice configuration containing allowed tools.
|
|
9579
9736
|
*/
|
|
9580
|
-
declare type ToolChoice = ToolChoiceType | ToolChoiceConfig;
|
|
9581
|
-
|
|
9582
9737
|
declare interface ToolChoiceConfig {
|
|
9583
9738
|
/**
|
|
9584
|
-
* The
|
|
9739
|
+
* The allowed tools.
|
|
9585
9740
|
*/
|
|
9586
9741
|
allowed_tools?: AllowedTools;
|
|
9587
9742
|
}
|
|
@@ -9992,10 +10147,10 @@ declare namespace types {
|
|
|
9992
10147
|
Language,
|
|
9993
10148
|
FunctionResponseScheduling,
|
|
9994
10149
|
Type,
|
|
10150
|
+
PhishBlockThreshold,
|
|
9995
10151
|
ApiSpec,
|
|
9996
10152
|
AuthType,
|
|
9997
10153
|
HttpElementLocation,
|
|
9998
|
-
PhishBlockThreshold,
|
|
9999
10154
|
Behavior,
|
|
10000
10155
|
DynamicRetrievalConfigMode,
|
|
10001
10156
|
FunctionCallingConfigMode,
|
|
@@ -10019,6 +10174,8 @@ declare namespace types {
|
|
|
10019
10174
|
ResourceScope,
|
|
10020
10175
|
FeatureSelectionPreference,
|
|
10021
10176
|
Environment,
|
|
10177
|
+
ProminentPeople,
|
|
10178
|
+
EmbeddingApiType,
|
|
10022
10179
|
SafetyFilterLevel,
|
|
10023
10180
|
PersonGeneration,
|
|
10024
10181
|
ImagePromptLanguage,
|
|
@@ -10065,6 +10222,11 @@ declare namespace types {
|
|
|
10065
10222
|
ModelSelectionConfig,
|
|
10066
10223
|
ComputerUse,
|
|
10067
10224
|
FileSearch,
|
|
10225
|
+
WebSearch,
|
|
10226
|
+
ImageSearch,
|
|
10227
|
+
SearchTypes,
|
|
10228
|
+
Interval,
|
|
10229
|
+
GoogleSearch,
|
|
10068
10230
|
ApiAuthApiKeyConfig,
|
|
10069
10231
|
ApiAuth,
|
|
10070
10232
|
ApiKeyConfig,
|
|
@@ -10091,11 +10253,11 @@ declare namespace types {
|
|
|
10091
10253
|
EnterpriseWebSearch,
|
|
10092
10254
|
FunctionDeclaration,
|
|
10093
10255
|
GoogleMaps,
|
|
10094
|
-
Interval,
|
|
10095
|
-
GoogleSearch,
|
|
10096
10256
|
DynamicRetrievalConfig,
|
|
10097
10257
|
GoogleSearchRetrieval,
|
|
10098
10258
|
UrlContext,
|
|
10259
|
+
StreamableHttpTransport,
|
|
10260
|
+
McpServer,
|
|
10099
10261
|
Tool,
|
|
10100
10262
|
LatLng,
|
|
10101
10263
|
RetrievalConfig,
|
|
@@ -10122,6 +10284,7 @@ declare namespace types {
|
|
|
10122
10284
|
GoogleTypeDate,
|
|
10123
10285
|
Citation,
|
|
10124
10286
|
CitationMetadata,
|
|
10287
|
+
GroundingChunkImage,
|
|
10125
10288
|
GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution,
|
|
10126
10289
|
GroundingChunkMapsPlaceAnswerSourcesReviewSnippet,
|
|
10127
10290
|
GroundingChunkMapsPlaceAnswerSources,
|
|
@@ -10151,7 +10314,7 @@ declare namespace types {
|
|
|
10151
10314
|
ReferenceImage,
|
|
10152
10315
|
EditImageParameters,
|
|
10153
10316
|
EmbedContentConfig,
|
|
10154
|
-
|
|
10317
|
+
EmbedContentParametersPrivate,
|
|
10155
10318
|
ContentEmbeddingStatistics,
|
|
10156
10319
|
ContentEmbedding,
|
|
10157
10320
|
EmbedContentMetadata,
|
|
@@ -10419,6 +10582,7 @@ declare namespace types {
|
|
|
10419
10582
|
CountTokensResult,
|
|
10420
10583
|
ComputeTokensResult,
|
|
10421
10584
|
CreateTuningJobParameters,
|
|
10585
|
+
EmbedContentParameters,
|
|
10422
10586
|
UploadToFileSearchStoreResponse,
|
|
10423
10587
|
UploadToFileSearchStoreOperation,
|
|
10424
10588
|
BlobImageUnion,
|
|
@@ -10731,15 +10895,15 @@ declare interface URLContextCallArguments {
|
|
|
10731
10895
|
* URL context content.
|
|
10732
10896
|
*/
|
|
10733
10897
|
declare interface URLContextCallContent {
|
|
10734
|
-
type: 'url_context_call';
|
|
10735
10898
|
/**
|
|
10736
10899
|
* A unique ID for this specific tool call.
|
|
10737
10900
|
*/
|
|
10738
|
-
id
|
|
10901
|
+
id: string;
|
|
10739
10902
|
/**
|
|
10740
10903
|
* The arguments to pass to the URL context.
|
|
10741
10904
|
*/
|
|
10742
|
-
arguments
|
|
10905
|
+
arguments: URLContextCallArguments;
|
|
10906
|
+
type: 'url_context_call';
|
|
10743
10907
|
}
|
|
10744
10908
|
|
|
10745
10909
|
/** Metadata related to url context retrieval tool. */
|
|
@@ -10766,19 +10930,19 @@ declare interface URLContextResult {
|
|
|
10766
10930
|
* URL context result content.
|
|
10767
10931
|
*/
|
|
10768
10932
|
declare interface URLContextResultContent {
|
|
10769
|
-
type: 'url_context_result';
|
|
10770
10933
|
/**
|
|
10771
10934
|
* ID to match the ID from the url context call block.
|
|
10772
10935
|
*/
|
|
10773
|
-
call_id
|
|
10936
|
+
call_id: string;
|
|
10774
10937
|
/**
|
|
10775
|
-
*
|
|
10938
|
+
* The results of the URL context.
|
|
10776
10939
|
*/
|
|
10777
|
-
|
|
10940
|
+
result: Array<URLContextResult>;
|
|
10941
|
+
type: 'url_context_result';
|
|
10778
10942
|
/**
|
|
10779
|
-
*
|
|
10943
|
+
* Whether the URL context resulted in an error.
|
|
10780
10944
|
*/
|
|
10781
|
-
|
|
10945
|
+
is_error?: boolean;
|
|
10782
10946
|
/**
|
|
10783
10947
|
* The signature of the URL context result.
|
|
10784
10948
|
*/
|
|
@@ -11065,7 +11229,7 @@ declare interface VideoContent {
|
|
|
11065
11229
|
/**
|
|
11066
11230
|
* The mime type of the video.
|
|
11067
11231
|
*/
|
|
11068
|
-
mime_type?:
|
|
11232
|
+
mime_type?: 'video/mp4' | 'video/mpeg' | 'video/mpg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/webm' | 'video/wmv' | 'video/3gpp';
|
|
11069
11233
|
/**
|
|
11070
11234
|
* The resolution of the media.
|
|
11071
11235
|
*/
|
|
@@ -11147,11 +11311,6 @@ export declare interface VideoMetadata {
|
|
|
11147
11311
|
startOffset?: string;
|
|
11148
11312
|
}
|
|
11149
11313
|
|
|
11150
|
-
/**
|
|
11151
|
-
* The mime type of the video.
|
|
11152
|
-
*/
|
|
11153
|
-
declare type VideoMimeType = 'video/mp4' | 'video/mpeg' | 'video/mov' | 'video/avi' | 'video/x-flv' | 'video/mpg' | 'video/webm' | 'video/wmv' | 'video/3gpp' | (string & {});
|
|
11154
|
-
|
|
11155
11314
|
/** Voice activity signal. */
|
|
11156
11315
|
export declare interface VoiceActivity {
|
|
11157
11316
|
/** The type of the voice activity signal. */
|
|
@@ -11186,6 +11345,12 @@ export declare interface VoiceConfig {
|
|
|
11186
11345
|
prebuiltVoiceConfig?: PrebuiltVoiceConfig;
|
|
11187
11346
|
}
|
|
11188
11347
|
|
|
11348
|
+
/** Standard web search for grounding and related configurations.
|
|
11349
|
+
|
|
11350
|
+
Only text results are returned. */
|
|
11351
|
+
export declare interface WebSearch {
|
|
11352
|
+
}
|
|
11353
|
+
|
|
11189
11354
|
declare interface WebSocket_2 {
|
|
11190
11355
|
/**
|
|
11191
11356
|
* Connects the socket to the server.
|