@firebase/ai 2.3.0 → 2.4.0-canary.22e0a1adb
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/ai-public.d.ts +240 -35
- package/dist/ai.d.ts +241 -35
- package/dist/esm/index.esm.js +295 -92
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/api.d.ts +1 -1
- package/dist/esm/src/methods/chrome-adapter.d.ts +1 -1
- package/dist/esm/src/methods/live-session-helpers.d.ts +2 -2
- package/dist/esm/src/methods/live-session.d.ts +71 -7
- package/dist/esm/src/models/imagen-model.d.ts +2 -2
- package/dist/esm/src/requests/hybrid-helpers.d.ts +7 -2
- package/dist/esm/src/requests/imagen-image-format.d.ts +3 -3
- package/dist/esm/src/requests/response-helpers.d.ts +2 -2
- package/dist/esm/src/requests/stream-reader.d.ts +2 -1
- package/dist/esm/src/types/content.d.ts +4 -4
- package/dist/esm/src/types/enums.d.ts +19 -4
- package/dist/esm/src/types/googleai.d.ts +2 -1
- package/dist/esm/src/types/imagen/requests.d.ts +9 -9
- package/dist/esm/src/types/imagen/responses.d.ts +3 -3
- package/dist/esm/src/types/live-responses.d.ts +16 -2
- package/dist/esm/src/types/requests.d.ts +22 -2
- package/dist/esm/src/types/responses.d.ts +99 -1
- package/dist/index.cjs.js +296 -91
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +276 -84
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +275 -85
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/api.d.ts +1 -1
- package/dist/src/methods/chrome-adapter.d.ts +1 -1
- package/dist/src/methods/live-session-helpers.d.ts +2 -2
- package/dist/src/methods/live-session.d.ts +71 -7
- package/dist/src/models/imagen-model.d.ts +2 -2
- package/dist/src/requests/hybrid-helpers.d.ts +7 -2
- package/dist/src/requests/imagen-image-format.d.ts +3 -3
- package/dist/src/requests/response-helpers.d.ts +2 -2
- package/dist/src/requests/stream-reader.d.ts +2 -1
- package/dist/src/types/content.d.ts +4 -4
- package/dist/src/types/enums.d.ts +19 -4
- package/dist/src/types/googleai.d.ts +2 -1
- package/dist/src/types/imagen/requests.d.ts +9 -9
- package/dist/src/types/imagen/responses.d.ts +3 -3
- package/dist/src/types/live-responses.d.ts +16 -2
- package/dist/src/types/requests.d.ts +22 -2
- package/dist/src/types/responses.d.ts +99 -1
- package/package.json +8 -8
package/dist/ai.d.ts
CHANGED
|
@@ -439,7 +439,7 @@ export declare interface CitationMetadata {
|
|
|
439
439
|
/**
|
|
440
440
|
* The results of code execution run by the model.
|
|
441
441
|
*
|
|
442
|
-
* @
|
|
442
|
+
* @beta
|
|
443
443
|
*/
|
|
444
444
|
export declare interface CodeExecutionResult {
|
|
445
445
|
/**
|
|
@@ -456,7 +456,7 @@ export declare interface CodeExecutionResult {
|
|
|
456
456
|
/**
|
|
457
457
|
* Represents the code execution result from the model.
|
|
458
458
|
*
|
|
459
|
-
* @
|
|
459
|
+
* @beta
|
|
460
460
|
*/
|
|
461
461
|
export declare interface CodeExecutionResultPart {
|
|
462
462
|
text?: never;
|
|
@@ -476,7 +476,7 @@ export declare interface CodeExecutionResultPart {
|
|
|
476
476
|
/**
|
|
477
477
|
* A tool that enables the model to use code execution.
|
|
478
478
|
*
|
|
479
|
-
* @
|
|
479
|
+
* @beta
|
|
480
480
|
*/
|
|
481
481
|
export declare interface CodeExecutionTool {
|
|
482
482
|
/**
|
|
@@ -604,6 +604,12 @@ export declare interface EnhancedGenerateContentResponse extends GenerateContent
|
|
|
604
604
|
* set to `true`.
|
|
605
605
|
*/
|
|
606
606
|
thoughtSummary: () => string | undefined;
|
|
607
|
+
/**
|
|
608
|
+
* Indicates whether inference happened on-device or in-cloud.
|
|
609
|
+
*
|
|
610
|
+
* @beta
|
|
611
|
+
*/
|
|
612
|
+
inferenceSource?: InferenceSource;
|
|
607
613
|
}
|
|
608
614
|
|
|
609
615
|
/**
|
|
@@ -626,7 +632,7 @@ export declare interface ErrorDetails {
|
|
|
626
632
|
/**
|
|
627
633
|
* An interface for executable code returned by the model.
|
|
628
634
|
*
|
|
629
|
-
* @
|
|
635
|
+
* @beta
|
|
630
636
|
*/
|
|
631
637
|
export declare interface ExecutableCode {
|
|
632
638
|
/**
|
|
@@ -642,7 +648,7 @@ export declare interface ExecutableCode {
|
|
|
642
648
|
/**
|
|
643
649
|
* Represents the code that is executed by the model.
|
|
644
650
|
*
|
|
645
|
-
* @
|
|
651
|
+
* @beta
|
|
646
652
|
*/
|
|
647
653
|
export declare interface ExecutableCodePart {
|
|
648
654
|
text?: never;
|
|
@@ -911,6 +917,7 @@ export declare interface GenerateContentCandidate {
|
|
|
911
917
|
safetyRatings?: SafetyRating[];
|
|
912
918
|
citationMetadata?: CitationMetadata;
|
|
913
919
|
groundingMetadata?: GroundingMetadata;
|
|
920
|
+
urlContextMetadata?: URLContextMetadata;
|
|
914
921
|
}
|
|
915
922
|
|
|
916
923
|
/**
|
|
@@ -1102,7 +1109,7 @@ export declare function getGenerativeModel(ai: AI, modelParams: ModelParams | Hy
|
|
|
1102
1109
|
* @throws If the `apiKey` or `projectId` fields are missing in your
|
|
1103
1110
|
* Firebase config.
|
|
1104
1111
|
*
|
|
1105
|
-
* @
|
|
1112
|
+
* @public
|
|
1106
1113
|
*/
|
|
1107
1114
|
export declare function getImagenModel(ai: AI, modelParams: ImagenModelParams, requestOptions?: RequestOptions): ImagenModel;
|
|
1108
1115
|
|
|
@@ -1166,6 +1173,7 @@ export declare interface GoogleAIGenerateContentCandidate {
|
|
|
1166
1173
|
safetyRatings?: SafetyRating[];
|
|
1167
1174
|
citationMetadata?: GoogleAICitationMetadata;
|
|
1168
1175
|
groundingMetadata?: GroundingMetadata;
|
|
1176
|
+
urlContextMetadata?: URLContextMetadata;
|
|
1169
1177
|
}
|
|
1170
1178
|
|
|
1171
1179
|
/**
|
|
@@ -1452,7 +1460,7 @@ export declare interface HybridParams {
|
|
|
1452
1460
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
1453
1461
|
* for more details and examples of the supported aspect ratios.
|
|
1454
1462
|
*
|
|
1455
|
-
* @
|
|
1463
|
+
* @public
|
|
1456
1464
|
*/
|
|
1457
1465
|
export declare const ImagenAspectRatio: {
|
|
1458
1466
|
/**
|
|
@@ -1486,7 +1494,7 @@ export declare const ImagenAspectRatio: {
|
|
|
1486
1494
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
1487
1495
|
* for more details and examples of the supported aspect ratios.
|
|
1488
1496
|
*
|
|
1489
|
-
* @
|
|
1497
|
+
* @public
|
|
1490
1498
|
*/
|
|
1491
1499
|
export declare type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof ImagenAspectRatio];
|
|
1492
1500
|
|
|
@@ -1494,7 +1502,7 @@ export declare type ImagenAspectRatio = (typeof ImagenAspectRatio)[keyof typeof
|
|
|
1494
1502
|
* An image generated by Imagen, stored in a Cloud Storage for Firebase bucket.
|
|
1495
1503
|
*
|
|
1496
1504
|
* This feature is not available yet.
|
|
1497
|
-
* @
|
|
1505
|
+
* @public
|
|
1498
1506
|
*/
|
|
1499
1507
|
export declare interface ImagenGCSImage {
|
|
1500
1508
|
/**
|
|
@@ -1517,7 +1525,7 @@ export declare interface ImagenGCSImage {
|
|
|
1517
1525
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images-imagen | documentation} for
|
|
1518
1526
|
* more details.
|
|
1519
1527
|
*
|
|
1520
|
-
* @
|
|
1528
|
+
* @public
|
|
1521
1529
|
*/
|
|
1522
1530
|
export declare interface ImagenGenerationConfig {
|
|
1523
1531
|
/**
|
|
@@ -1569,7 +1577,7 @@ export declare interface ImagenGenerationConfig {
|
|
|
1569
1577
|
/**
|
|
1570
1578
|
* The response from a request to generate images with Imagen.
|
|
1571
1579
|
*
|
|
1572
|
-
* @
|
|
1580
|
+
* @public
|
|
1573
1581
|
*/
|
|
1574
1582
|
export declare interface ImagenGenerationResponse<T extends ImagenInlineImage | ImagenGCSImage> {
|
|
1575
1583
|
/**
|
|
@@ -1624,7 +1632,7 @@ export declare interface ImagenGenerationResponse<T extends ImagenInlineImage |
|
|
|
1624
1632
|
* }
|
|
1625
1633
|
* ```
|
|
1626
1634
|
*
|
|
1627
|
-
* @
|
|
1635
|
+
* @public
|
|
1628
1636
|
*/
|
|
1629
1637
|
export declare class ImagenImageFormat {
|
|
1630
1638
|
/**
|
|
@@ -1642,7 +1650,7 @@ export declare class ImagenImageFormat {
|
|
|
1642
1650
|
* @param compressionQuality - The level of compression (a number between 0 and 100).
|
|
1643
1651
|
* @returns An {@link ImagenImageFormat} object for a JPEG image.
|
|
1644
1652
|
*
|
|
1645
|
-
* @
|
|
1653
|
+
* @public
|
|
1646
1654
|
*/
|
|
1647
1655
|
static jpeg(compressionQuality?: number): ImagenImageFormat;
|
|
1648
1656
|
/**
|
|
@@ -1650,7 +1658,7 @@ export declare class ImagenImageFormat {
|
|
|
1650
1658
|
*
|
|
1651
1659
|
* @returns An {@link ImagenImageFormat} object for a PNG image.
|
|
1652
1660
|
*
|
|
1653
|
-
* @
|
|
1661
|
+
* @public
|
|
1654
1662
|
*/
|
|
1655
1663
|
static png(): ImagenImageFormat;
|
|
1656
1664
|
}
|
|
@@ -1674,7 +1682,7 @@ export declare class ImagenImageFormat {
|
|
|
1674
1682
|
/**
|
|
1675
1683
|
* An image generated by Imagen, represented as inline data.
|
|
1676
1684
|
*
|
|
1677
|
-
* @
|
|
1685
|
+
* @public
|
|
1678
1686
|
*/
|
|
1679
1687
|
export declare interface ImagenInlineImage {
|
|
1680
1688
|
/**
|
|
@@ -1709,7 +1717,7 @@ export declare interface ImagenInlineImage {
|
|
|
1709
1717
|
* }
|
|
1710
1718
|
* ```
|
|
1711
1719
|
*
|
|
1712
|
-
* @
|
|
1720
|
+
* @public
|
|
1713
1721
|
*/
|
|
1714
1722
|
export declare class ImagenModel extends AIModel {
|
|
1715
1723
|
requestOptions?: RequestOptions | undefined;
|
|
@@ -1748,7 +1756,7 @@ export declare class ImagenModel extends AIModel {
|
|
|
1748
1756
|
* returned object will have a `filteredReason` property.
|
|
1749
1757
|
* If all images are filtered, the `images` array will be empty.
|
|
1750
1758
|
*
|
|
1751
|
-
* @
|
|
1759
|
+
* @public
|
|
1752
1760
|
*/
|
|
1753
1761
|
generateImages(prompt: string): Promise<ImagenGenerationResponse<ImagenInlineImage>>;
|
|
1754
1762
|
/**
|
|
@@ -1776,7 +1784,7 @@ export declare class ImagenModel extends AIModel {
|
|
|
1776
1784
|
/**
|
|
1777
1785
|
* Parameters for configuring an {@link ImagenModel}.
|
|
1778
1786
|
*
|
|
1779
|
-
* @
|
|
1787
|
+
* @public
|
|
1780
1788
|
*/
|
|
1781
1789
|
export declare interface ImagenModelParams {
|
|
1782
1790
|
/**
|
|
@@ -1805,7 +1813,7 @@ export declare interface ImagenModelParams {
|
|
|
1805
1813
|
* See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
|
|
1806
1814
|
* documentation for more details.
|
|
1807
1815
|
*
|
|
1808
|
-
* @
|
|
1816
|
+
* @public
|
|
1809
1817
|
*/
|
|
1810
1818
|
export declare const ImagenPersonFilterLevel: {
|
|
1811
1819
|
/**
|
|
@@ -1836,7 +1844,7 @@ export declare const ImagenPersonFilterLevel: {
|
|
|
1836
1844
|
* See the <a href="http://firebase.google.com/docs/vertex-ai/generate-images">personGeneration</a>
|
|
1837
1845
|
* documentation for more details.
|
|
1838
1846
|
*
|
|
1839
|
-
* @
|
|
1847
|
+
* @public
|
|
1840
1848
|
*/
|
|
1841
1849
|
export declare type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[keyof typeof ImagenPersonFilterLevel];
|
|
1842
1850
|
|
|
@@ -1850,7 +1858,7 @@ export declare type ImagenPersonFilterLevel = (typeof ImagenPersonFilterLevel)[k
|
|
|
1850
1858
|
* and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
|
|
1851
1859
|
* for more details.
|
|
1852
1860
|
*
|
|
1853
|
-
* @
|
|
1861
|
+
* @public
|
|
1854
1862
|
*/
|
|
1855
1863
|
export declare const ImagenSafetyFilterLevel: {
|
|
1856
1864
|
/**
|
|
@@ -1884,7 +1892,7 @@ export declare const ImagenSafetyFilterLevel: {
|
|
|
1884
1892
|
* and the {@link https://cloud.google.com/vertex-ai/generative-ai/docs/image/responsible-ai-imagen#safety-filters | Responsible AI and usage guidelines}
|
|
1885
1893
|
* for more details.
|
|
1886
1894
|
*
|
|
1887
|
-
* @
|
|
1895
|
+
* @public
|
|
1888
1896
|
*/
|
|
1889
1897
|
export declare type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[keyof typeof ImagenSafetyFilterLevel];
|
|
1890
1898
|
|
|
@@ -1894,7 +1902,7 @@ export declare type ImagenSafetyFilterLevel = (typeof ImagenSafetyFilterLevel)[k
|
|
|
1894
1902
|
* See the {@link http://firebase.google.com/docs/vertex-ai/generate-images | documentation }
|
|
1895
1903
|
* for more details.
|
|
1896
1904
|
*
|
|
1897
|
-
* @
|
|
1905
|
+
* @public
|
|
1898
1906
|
*/
|
|
1899
1907
|
export declare interface ImagenSafetySettings {
|
|
1900
1908
|
/**
|
|
@@ -1943,6 +1951,23 @@ export declare const InferenceMode: {
|
|
|
1943
1951
|
*/
|
|
1944
1952
|
export declare type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
|
|
1945
1953
|
|
|
1954
|
+
/**
|
|
1955
|
+
* Indicates whether inference happened on-device or in-cloud.
|
|
1956
|
+
*
|
|
1957
|
+
* @beta
|
|
1958
|
+
*/
|
|
1959
|
+
export declare const InferenceSource: {
|
|
1960
|
+
readonly ON_DEVICE: "on_device";
|
|
1961
|
+
readonly IN_CLOUD: "in_cloud";
|
|
1962
|
+
};
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Indicates whether inference happened on-device or in-cloud.
|
|
1966
|
+
*
|
|
1967
|
+
* @beta
|
|
1968
|
+
*/
|
|
1969
|
+
export declare type InferenceSource = (typeof InferenceSource)[keyof typeof InferenceSource];
|
|
1970
|
+
|
|
1946
1971
|
/**
|
|
1947
1972
|
* Content part interface if the part represents an image.
|
|
1948
1973
|
* @public
|
|
@@ -1976,7 +2001,7 @@ export declare class IntegerSchema extends Schema {
|
|
|
1976
2001
|
/**
|
|
1977
2002
|
* The programming language of the code.
|
|
1978
2003
|
*
|
|
1979
|
-
* @
|
|
2004
|
+
* @beta
|
|
1980
2005
|
*/
|
|
1981
2006
|
export declare const Language: {
|
|
1982
2007
|
UNSPECIFIED: string;
|
|
@@ -1986,7 +2011,7 @@ export declare const Language: {
|
|
|
1986
2011
|
/**
|
|
1987
2012
|
* The programming language of the code.
|
|
1988
2013
|
*
|
|
1989
|
-
* @
|
|
2014
|
+
* @beta
|
|
1990
2015
|
*/
|
|
1991
2016
|
export declare type Language = (typeof Language)[keyof typeof Language];
|
|
1992
2017
|
|
|
@@ -2266,23 +2291,65 @@ export declare class LiveSession {
|
|
|
2266
2291
|
*/
|
|
2267
2292
|
send(request: string | Array<string | Part>, turnComplete?: boolean): Promise<void>;
|
|
2268
2293
|
/**
|
|
2269
|
-
* Sends
|
|
2294
|
+
* Sends text to the server in realtime.
|
|
2270
2295
|
*
|
|
2271
|
-
* @
|
|
2296
|
+
* @example
|
|
2297
|
+
* ```javascript
|
|
2298
|
+
* liveSession.sendTextRealtime("Hello, how are you?");
|
|
2299
|
+
* ```
|
|
2300
|
+
*
|
|
2301
|
+
* @param text - The text data to send.
|
|
2272
2302
|
* @throws If this session has been closed.
|
|
2273
2303
|
*
|
|
2274
2304
|
* @beta
|
|
2275
2305
|
*/
|
|
2276
|
-
|
|
2306
|
+
sendTextRealtime(text: string): Promise<void>;
|
|
2277
2307
|
/**
|
|
2278
|
-
* Sends
|
|
2308
|
+
* Sends audio data to the server in realtime.
|
|
2279
2309
|
*
|
|
2280
|
-
* @
|
|
2310
|
+
* @remarks The server requires that the audio data is base64-encoded 16-bit PCM at 16kHz
|
|
2311
|
+
* little-endian.
|
|
2312
|
+
*
|
|
2313
|
+
* @example
|
|
2314
|
+
* ```javascript
|
|
2315
|
+
* // const pcmData = ... base64-encoded 16-bit PCM at 16kHz little-endian.
|
|
2316
|
+
* const blob = { mimeType: "audio/pcm", data: pcmData };
|
|
2317
|
+
* liveSession.sendAudioRealtime(blob);
|
|
2318
|
+
* ```
|
|
2319
|
+
*
|
|
2320
|
+
* @param blob - The base64-encoded PCM data to send to the server in realtime.
|
|
2281
2321
|
* @throws If this session has been closed.
|
|
2282
2322
|
*
|
|
2283
2323
|
* @beta
|
|
2284
2324
|
*/
|
|
2285
|
-
|
|
2325
|
+
sendAudioRealtime(blob: GenerativeContentBlob): Promise<void>;
|
|
2326
|
+
/**
|
|
2327
|
+
* Sends video data to the server in realtime.
|
|
2328
|
+
*
|
|
2329
|
+
* @remarks The server requires that the video is sent as individual video frames at 1 FPS. It
|
|
2330
|
+
* is recommended to set `mimeType` to `image/jpeg`.
|
|
2331
|
+
*
|
|
2332
|
+
* @example
|
|
2333
|
+
* ```javascript
|
|
2334
|
+
* // const videoFrame = ... base64-encoded JPEG data
|
|
2335
|
+
* const blob = { mimeType: "image/jpeg", data: videoFrame };
|
|
2336
|
+
* liveSession.sendVideoRealtime(blob);
|
|
2337
|
+
* ```
|
|
2338
|
+
* @param blob - The base64-encoded video data to send to the server in realtime.
|
|
2339
|
+
* @throws If this session has been closed.
|
|
2340
|
+
*
|
|
2341
|
+
* @beta
|
|
2342
|
+
*/
|
|
2343
|
+
sendVideoRealtime(blob: GenerativeContentBlob): Promise<void>;
|
|
2344
|
+
/**
|
|
2345
|
+
* Sends function responses to the server.
|
|
2346
|
+
*
|
|
2347
|
+
* @param functionResponses - The function responses to send.
|
|
2348
|
+
* @throws If this session has been closed.
|
|
2349
|
+
*
|
|
2350
|
+
* @beta
|
|
2351
|
+
*/
|
|
2352
|
+
sendFunctionResponses(functionResponses: FunctionResponse[]): Promise<void>;
|
|
2286
2353
|
/**
|
|
2287
2354
|
* Yields messages received from the server.
|
|
2288
2355
|
* This can only be used by one consumer at a time.
|
|
@@ -2300,6 +2367,28 @@ export declare class LiveSession {
|
|
|
2300
2367
|
* @beta
|
|
2301
2368
|
*/
|
|
2302
2369
|
close(): Promise<void>;
|
|
2370
|
+
/**
|
|
2371
|
+
* Sends realtime input to the server.
|
|
2372
|
+
*
|
|
2373
|
+
* @deprecated Use `sendTextRealtime()`, `sendAudioRealtime()`, and `sendVideoRealtime()` instead.
|
|
2374
|
+
*
|
|
2375
|
+
* @param mediaChunks - The media chunks to send.
|
|
2376
|
+
* @throws If this session has been closed.
|
|
2377
|
+
*
|
|
2378
|
+
* @beta
|
|
2379
|
+
*/
|
|
2380
|
+
sendMediaChunks(mediaChunks: GenerativeContentBlob[]): Promise<void>;
|
|
2381
|
+
/**
|
|
2382
|
+
* @deprecated Use `sendTextRealtime()`, `sendAudioRealtime()`, and `sendVideoRealtime()` instead.
|
|
2383
|
+
*
|
|
2384
|
+
* Sends a stream of {@link GenerativeContentBlob}.
|
|
2385
|
+
*
|
|
2386
|
+
* @param mediaChunkStream - The stream of {@link GenerativeContentBlob} to send.
|
|
2387
|
+
* @throws If this session has been closed.
|
|
2388
|
+
*
|
|
2389
|
+
* @beta
|
|
2390
|
+
*/
|
|
2391
|
+
sendMediaStream(mediaChunkStream: ReadableStream<GenerativeContentBlob>): Promise<void>;
|
|
2303
2392
|
}
|
|
2304
2393
|
|
|
2305
2394
|
/**
|
|
@@ -2419,7 +2508,7 @@ export declare interface OnDeviceParams {
|
|
|
2419
2508
|
/**
|
|
2420
2509
|
* Represents the result of the code execution.
|
|
2421
2510
|
*
|
|
2422
|
-
* @
|
|
2511
|
+
* @beta
|
|
2423
2512
|
*/
|
|
2424
2513
|
export declare const Outcome: {
|
|
2425
2514
|
UNSPECIFIED: string;
|
|
@@ -2431,7 +2520,7 @@ export declare const Outcome: {
|
|
|
2431
2520
|
/**
|
|
2432
2521
|
* Represents the result of the code execution.
|
|
2433
2522
|
*
|
|
2434
|
-
* @
|
|
2523
|
+
* @beta
|
|
2435
2524
|
*/
|
|
2436
2525
|
export declare type Outcome = (typeof Outcome)[keyof typeof Outcome];
|
|
2437
2526
|
|
|
@@ -2911,7 +3000,7 @@ export declare interface StartAudioConversationOptions {
|
|
|
2911
3000
|
* The handler should perform the function call and return the result as a `Part`,
|
|
2912
3001
|
* which will then be sent back to the model.
|
|
2913
3002
|
*/
|
|
2914
|
-
functionCallingHandler?: (functionCalls:
|
|
3003
|
+
functionCallingHandler?: (functionCalls: FunctionCall[]) => Promise<FunctionResponse>;
|
|
2915
3004
|
}
|
|
2916
3005
|
|
|
2917
3006
|
/**
|
|
@@ -2995,7 +3084,7 @@ export declare interface ThinkingConfig {
|
|
|
2995
3084
|
* Defines a tool that model can call to access external knowledge.
|
|
2996
3085
|
* @public
|
|
2997
3086
|
*/
|
|
2998
|
-
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool;
|
|
3087
|
+
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool | URLContextTool;
|
|
2999
3088
|
|
|
3000
3089
|
/**
|
|
3001
3090
|
* Tool config. This config is shared for all tools provided in the request.
|
|
@@ -3011,6 +3100,115 @@ export declare interface ToolConfig {
|
|
|
3011
3100
|
*/
|
|
3012
3101
|
export declare type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
|
|
3013
3102
|
|
|
3103
|
+
/**
|
|
3104
|
+
* Specifies the URL Context configuration.
|
|
3105
|
+
*
|
|
3106
|
+
* @beta
|
|
3107
|
+
*/
|
|
3108
|
+
export declare interface URLContext {
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
/**
|
|
3112
|
+
* Metadata related to {@link URLContextTool}.
|
|
3113
|
+
*
|
|
3114
|
+
* @beta
|
|
3115
|
+
*/
|
|
3116
|
+
export declare interface URLContextMetadata {
|
|
3117
|
+
/**
|
|
3118
|
+
* List of URL metadata used to provide context to the Gemini model.
|
|
3119
|
+
*/
|
|
3120
|
+
urlMetadata: URLMetadata[];
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
/**
|
|
3124
|
+
* A tool that allows you to provide additional context to the models in the form of public web
|
|
3125
|
+
* URLs. By including URLs in your request, the Gemini model will access the content from those
|
|
3126
|
+
* pages to inform and enhance its response.
|
|
3127
|
+
*
|
|
3128
|
+
* @beta
|
|
3129
|
+
*/
|
|
3130
|
+
export declare interface URLContextTool {
|
|
3131
|
+
/**
|
|
3132
|
+
* Specifies the URL Context configuration.
|
|
3133
|
+
*/
|
|
3134
|
+
urlContext: URLContext;
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
/**
|
|
3138
|
+
* Metadata for a single URL retrieved by the {@link URLContextTool} tool.
|
|
3139
|
+
*
|
|
3140
|
+
* @beta
|
|
3141
|
+
*/
|
|
3142
|
+
export declare interface URLMetadata {
|
|
3143
|
+
/**
|
|
3144
|
+
* The retrieved URL.
|
|
3145
|
+
*/
|
|
3146
|
+
retrievedUrl?: string;
|
|
3147
|
+
/**
|
|
3148
|
+
* The status of the URL retrieval.
|
|
3149
|
+
*/
|
|
3150
|
+
urlRetrievalStatus?: URLRetrievalStatus;
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
/**
|
|
3154
|
+
* The status of a URL retrieval.
|
|
3155
|
+
*
|
|
3156
|
+
* @remarks
|
|
3157
|
+
* <b>URL_RETRIEVAL_STATUS_UNSPECIFIED:</b> Unspecified retrieval status.
|
|
3158
|
+
* <br/>
|
|
3159
|
+
* <b>URL_RETRIEVAL_STATUS_SUCCESS:</b> The URL retrieval was successful.
|
|
3160
|
+
* <br/>
|
|
3161
|
+
* <b>URL_RETRIEVAL_STATUS_ERROR:</b> The URL retrieval failed.
|
|
3162
|
+
* <br/>
|
|
3163
|
+
* <b>URL_RETRIEVAL_STATUS_PAYWALL:</b> The URL retrieval failed because the content is behind a paywall.
|
|
3164
|
+
* <br/>
|
|
3165
|
+
* <b>URL_RETRIEVAL_STATUS_UNSAFE:</b> The URL retrieval failed because the content is unsafe.
|
|
3166
|
+
* <br/>
|
|
3167
|
+
*
|
|
3168
|
+
* @beta
|
|
3169
|
+
*/
|
|
3170
|
+
export declare const URLRetrievalStatus: {
|
|
3171
|
+
/**
|
|
3172
|
+
* Unspecified retrieval status.
|
|
3173
|
+
*/
|
|
3174
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED: string;
|
|
3175
|
+
/**
|
|
3176
|
+
* The URL retrieval was successful.
|
|
3177
|
+
*/
|
|
3178
|
+
URL_RETRIEVAL_STATUS_SUCCESS: string;
|
|
3179
|
+
/**
|
|
3180
|
+
* The URL retrieval failed.
|
|
3181
|
+
*/
|
|
3182
|
+
URL_RETRIEVAL_STATUS_ERROR: string;
|
|
3183
|
+
/**
|
|
3184
|
+
* The URL retrieval failed because the content is behind a paywall.
|
|
3185
|
+
*/
|
|
3186
|
+
URL_RETRIEVAL_STATUS_PAYWALL: string;
|
|
3187
|
+
/**
|
|
3188
|
+
* The URL retrieval failed because the content is unsafe.
|
|
3189
|
+
*/
|
|
3190
|
+
URL_RETRIEVAL_STATUS_UNSAFE: string;
|
|
3191
|
+
};
|
|
3192
|
+
|
|
3193
|
+
/**
|
|
3194
|
+
* The status of a URL retrieval.
|
|
3195
|
+
*
|
|
3196
|
+
* @remarks
|
|
3197
|
+
* <b>URL_RETRIEVAL_STATUS_UNSPECIFIED:</b> Unspecified retrieval status.
|
|
3198
|
+
* <br/>
|
|
3199
|
+
* <b>URL_RETRIEVAL_STATUS_SUCCESS:</b> The URL retrieval was successful.
|
|
3200
|
+
* <br/>
|
|
3201
|
+
* <b>URL_RETRIEVAL_STATUS_ERROR:</b> The URL retrieval failed.
|
|
3202
|
+
* <br/>
|
|
3203
|
+
* <b>URL_RETRIEVAL_STATUS_PAYWALL:</b> The URL retrieval failed because the content is behind a paywall.
|
|
3204
|
+
* <br/>
|
|
3205
|
+
* <b>URL_RETRIEVAL_STATUS_UNSAFE:</b> The URL retrieval failed because the content is unsafe.
|
|
3206
|
+
* <br/>
|
|
3207
|
+
*
|
|
3208
|
+
* @beta
|
|
3209
|
+
*/
|
|
3210
|
+
export declare type URLRetrievalStatus = (typeof URLRetrievalStatus)[keyof typeof URLRetrievalStatus];
|
|
3211
|
+
|
|
3014
3212
|
/**
|
|
3015
3213
|
* Usage metadata about a {@link GenerateContentResponse}.
|
|
3016
3214
|
*
|
|
@@ -3024,8 +3222,16 @@ export declare interface UsageMetadata {
|
|
|
3024
3222
|
*/
|
|
3025
3223
|
thoughtsTokenCount?: number;
|
|
3026
3224
|
totalTokenCount: number;
|
|
3225
|
+
/**
|
|
3226
|
+
* The number of tokens used by tools.
|
|
3227
|
+
*/
|
|
3228
|
+
toolUsePromptTokenCount?: number;
|
|
3027
3229
|
promptTokensDetails?: ModalityTokenCount[];
|
|
3028
3230
|
candidatesTokensDetails?: ModalityTokenCount[];
|
|
3231
|
+
/**
|
|
3232
|
+
* A list of tokens used by tools, broken down by modality.
|
|
3233
|
+
*/
|
|
3234
|
+
toolUsePromptTokensDetails?: ModalityTokenCount[];
|
|
3029
3235
|
}
|
|
3030
3236
|
|
|
3031
3237
|
/**
|