@firebase/ai 2.2.1-canary.4d834deb2 → 2.2.1-canary.9b8ab02c5
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 +147 -4
- package/dist/ai.d.ts +153 -4
- package/dist/esm/index.esm.js +618 -507
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/factory-browser.d.ts +19 -0
- package/dist/esm/src/requests/hybrid-helpers.d.ts +28 -0
- package/dist/esm/src/types/content.d.ts +81 -2
- package/dist/esm/src/types/enums.d.ts +51 -0
- package/dist/esm/src/types/requests.d.ts +13 -3
- package/dist/index.cjs.js +619 -506
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +115 -19
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +114 -20
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/factory-browser.d.ts +19 -0
- package/dist/src/requests/hybrid-helpers.d.ts +28 -0
- package/dist/src/types/content.d.ts +81 -2
- package/dist/src/types/enums.d.ts +51 -0
- package/dist/src/types/requests.d.ts +13 -3
- package/package.json +10 -9
package/dist/ai-public.d.ts
CHANGED
|
@@ -393,6 +393,53 @@ export declare interface CitationMetadata {
|
|
|
393
393
|
citations: Citation[];
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
+
/**
|
|
397
|
+
* The results of code execution run by the model.
|
|
398
|
+
*
|
|
399
|
+
* @public
|
|
400
|
+
*/
|
|
401
|
+
export declare interface CodeExecutionResult {
|
|
402
|
+
/**
|
|
403
|
+
* The result of the code execution.
|
|
404
|
+
*/
|
|
405
|
+
outcome?: Outcome;
|
|
406
|
+
/**
|
|
407
|
+
* The output from the code execution, or an error message
|
|
408
|
+
* if it failed.
|
|
409
|
+
*/
|
|
410
|
+
output?: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Represents the code execution result from the model.
|
|
415
|
+
*
|
|
416
|
+
* @public
|
|
417
|
+
*/
|
|
418
|
+
export declare interface CodeExecutionResultPart {
|
|
419
|
+
text?: never;
|
|
420
|
+
inlineData?: never;
|
|
421
|
+
functionCall?: never;
|
|
422
|
+
functionResponse?: never;
|
|
423
|
+
fileData: never;
|
|
424
|
+
thought?: never;
|
|
425
|
+
/* Excluded from this release type: thoughtSignature */
|
|
426
|
+
executableCode?: never;
|
|
427
|
+
codeExecutionResult?: CodeExecutionResult;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* A tool that enables the model to use code execution.
|
|
432
|
+
*
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
export declare interface CodeExecutionTool {
|
|
436
|
+
/**
|
|
437
|
+
* Specifies the Google Search configuration.
|
|
438
|
+
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
439
|
+
*/
|
|
440
|
+
codeExecution: {};
|
|
441
|
+
}
|
|
442
|
+
|
|
396
443
|
/**
|
|
397
444
|
* Content type for both prompts and response candidates.
|
|
398
445
|
* @public
|
|
@@ -530,6 +577,39 @@ export declare interface ErrorDetails {
|
|
|
530
577
|
[key: string]: unknown;
|
|
531
578
|
}
|
|
532
579
|
|
|
580
|
+
/**
|
|
581
|
+
* An interface for executable code returned by the model.
|
|
582
|
+
*
|
|
583
|
+
* @public
|
|
584
|
+
*/
|
|
585
|
+
export declare interface ExecutableCode {
|
|
586
|
+
/**
|
|
587
|
+
* The programming language of the code.
|
|
588
|
+
*/
|
|
589
|
+
language?: Language;
|
|
590
|
+
/**
|
|
591
|
+
* The source code to be executed.
|
|
592
|
+
*/
|
|
593
|
+
code?: string;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Represents the code that is executed by the model.
|
|
598
|
+
*
|
|
599
|
+
* @public
|
|
600
|
+
*/
|
|
601
|
+
export declare interface ExecutableCodePart {
|
|
602
|
+
text?: never;
|
|
603
|
+
inlineData?: never;
|
|
604
|
+
functionCall?: never;
|
|
605
|
+
functionResponse?: never;
|
|
606
|
+
fileData: never;
|
|
607
|
+
thought?: never;
|
|
608
|
+
/* Excluded from this release type: thoughtSignature */
|
|
609
|
+
executableCode?: ExecutableCode;
|
|
610
|
+
codeExecutionResult?: never;
|
|
611
|
+
}
|
|
612
|
+
|
|
533
613
|
/**
|
|
534
614
|
* Data pointing to a file uploaded on Google Cloud Storage.
|
|
535
615
|
* @public
|
|
@@ -551,6 +631,8 @@ export declare interface FileDataPart {
|
|
|
551
631
|
fileData: FileData;
|
|
552
632
|
thought?: boolean;
|
|
553
633
|
/* Excluded from this release type: thoughtSignature */
|
|
634
|
+
executableCode?: never;
|
|
635
|
+
codeExecutionResult?: never;
|
|
554
636
|
}
|
|
555
637
|
|
|
556
638
|
/**
|
|
@@ -669,6 +751,8 @@ export declare interface FunctionCallPart {
|
|
|
669
751
|
functionResponse?: never;
|
|
670
752
|
thought?: boolean;
|
|
671
753
|
/* Excluded from this release type: thoughtSignature */
|
|
754
|
+
executableCode?: never;
|
|
755
|
+
codeExecutionResult?: never;
|
|
672
756
|
}
|
|
673
757
|
|
|
674
758
|
/**
|
|
@@ -753,6 +837,8 @@ export declare interface FunctionResponsePart {
|
|
|
753
837
|
functionResponse: FunctionResponse;
|
|
754
838
|
thought?: boolean;
|
|
755
839
|
/* Excluded from this release type: thoughtSignature */
|
|
840
|
+
executableCode?: never;
|
|
841
|
+
codeExecutionResult?: never;
|
|
756
842
|
}
|
|
757
843
|
|
|
758
844
|
/**
|
|
@@ -1024,8 +1110,6 @@ export declare interface GoogleSearchTool {
|
|
|
1024
1110
|
/**
|
|
1025
1111
|
* Specifies the Google Search configuration.
|
|
1026
1112
|
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
1027
|
-
* Specifies the Google Search configuration. Currently, this is an empty object, but it's
|
|
1028
|
-
* reserved for future configuration options.
|
|
1029
1113
|
*
|
|
1030
1114
|
* When using this feature, you are required to comply with the "Grounding with Google Search"
|
|
1031
1115
|
* usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
|
|
@@ -1717,17 +1801,36 @@ export declare interface ImagenSafetySettings {
|
|
|
1717
1801
|
/**
|
|
1718
1802
|
* <b>(EXPERIMENTAL)</b>
|
|
1719
1803
|
* Determines whether inference happens on-device or in-cloud.
|
|
1804
|
+
*
|
|
1805
|
+
* @remarks
|
|
1806
|
+
* <b>PREFER_ON_DEVICE:</b> Attempt to make inference calls using an
|
|
1807
|
+
* on-device model. If on-device inference is not available, the SDK
|
|
1808
|
+
* will fall back to using a cloud-hosted model.
|
|
1809
|
+
* <br/>
|
|
1810
|
+
* <b>ONLY_ON_DEVICE:</b> Only attempt to make inference calls using an
|
|
1811
|
+
* on-device model. The SDK will not fall back to a cloud-hosted model.
|
|
1812
|
+
* If on-device inference is not available, inference methods will throw.
|
|
1813
|
+
* <br/>
|
|
1814
|
+
* <b>ONLY_IN_CLOUD:</b> Only attempt to make inference calls using a
|
|
1815
|
+
* cloud-hosted model. The SDK will not fall back to an on-device model.
|
|
1816
|
+
* <br/>
|
|
1817
|
+
* <b>PREFER_IN_CLOUD:</b> Attempt to make inference calls to a
|
|
1818
|
+
* cloud-hosted model. If not available, the SDK will fall back to an
|
|
1819
|
+
* on-device model.
|
|
1820
|
+
*
|
|
1720
1821
|
* @public
|
|
1721
1822
|
*/
|
|
1722
1823
|
export declare const InferenceMode: {
|
|
1723
1824
|
readonly PREFER_ON_DEVICE: "prefer_on_device";
|
|
1724
1825
|
readonly ONLY_ON_DEVICE: "only_on_device";
|
|
1725
1826
|
readonly ONLY_IN_CLOUD: "only_in_cloud";
|
|
1827
|
+
readonly PREFER_IN_CLOUD: "prefer_in_cloud";
|
|
1726
1828
|
};
|
|
1727
1829
|
|
|
1728
1830
|
/**
|
|
1729
1831
|
* <b>(EXPERIMENTAL)</b>
|
|
1730
1832
|
* Determines whether inference happens on-device or in-cloud.
|
|
1833
|
+
*
|
|
1731
1834
|
* @public
|
|
1732
1835
|
*/
|
|
1733
1836
|
export declare type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
|
|
@@ -1747,6 +1850,8 @@ export declare interface InlineDataPart {
|
|
|
1747
1850
|
videoMetadata?: VideoMetadata;
|
|
1748
1851
|
thought?: boolean;
|
|
1749
1852
|
/* Excluded from this release type: thoughtSignature */
|
|
1853
|
+
executableCode?: never;
|
|
1854
|
+
codeExecutionResult?: never;
|
|
1750
1855
|
}
|
|
1751
1856
|
|
|
1752
1857
|
/**
|
|
@@ -1757,6 +1862,23 @@ export declare class IntegerSchema extends Schema {
|
|
|
1757
1862
|
constructor(schemaParams?: SchemaParams);
|
|
1758
1863
|
}
|
|
1759
1864
|
|
|
1865
|
+
/**
|
|
1866
|
+
* The programming language of the code.
|
|
1867
|
+
*
|
|
1868
|
+
* @public
|
|
1869
|
+
*/
|
|
1870
|
+
export declare const Language: {
|
|
1871
|
+
UNSPECIFIED: string;
|
|
1872
|
+
PYTHON: string;
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1875
|
+
/**
|
|
1876
|
+
* The programming language of the code.
|
|
1877
|
+
*
|
|
1878
|
+
* @public
|
|
1879
|
+
*/
|
|
1880
|
+
export declare type Language = (typeof Language)[keyof typeof Language];
|
|
1881
|
+
|
|
1760
1882
|
/**
|
|
1761
1883
|
* <b>(EXPERIMENTAL)</b>
|
|
1762
1884
|
* Configures the creation of an on-device language model session.
|
|
@@ -2177,12 +2299,31 @@ export declare interface OnDeviceParams {
|
|
|
2177
2299
|
promptOptions?: LanguageModelPromptOptions;
|
|
2178
2300
|
}
|
|
2179
2301
|
|
|
2302
|
+
/**
|
|
2303
|
+
* Represents the result of the code execution.
|
|
2304
|
+
*
|
|
2305
|
+
* @public
|
|
2306
|
+
*/
|
|
2307
|
+
export declare const Outcome: {
|
|
2308
|
+
UNSPECIFIED: string;
|
|
2309
|
+
OK: string;
|
|
2310
|
+
FAILED: string;
|
|
2311
|
+
DEADLINE_EXCEEDED: string;
|
|
2312
|
+
};
|
|
2313
|
+
|
|
2314
|
+
/**
|
|
2315
|
+
* Represents the result of the code execution.
|
|
2316
|
+
*
|
|
2317
|
+
* @public
|
|
2318
|
+
*/
|
|
2319
|
+
export declare type Outcome = (typeof Outcome)[keyof typeof Outcome];
|
|
2320
|
+
|
|
2180
2321
|
/**
|
|
2181
2322
|
* Content part - includes text, image/video, or function call/response
|
|
2182
2323
|
* part types.
|
|
2183
2324
|
* @public
|
|
2184
2325
|
*/
|
|
2185
|
-
export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
|
|
2326
|
+
export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
|
|
2186
2327
|
|
|
2187
2328
|
/**
|
|
2188
2329
|
* Possible roles.
|
|
@@ -2684,6 +2825,8 @@ export declare interface TextPart {
|
|
|
2684
2825
|
functionResponse?: never;
|
|
2685
2826
|
thought?: boolean;
|
|
2686
2827
|
/* Excluded from this release type: thoughtSignature */
|
|
2828
|
+
executableCode?: never;
|
|
2829
|
+
codeExecutionResult?: never;
|
|
2687
2830
|
}
|
|
2688
2831
|
|
|
2689
2832
|
/**
|
|
@@ -2724,7 +2867,7 @@ export declare interface ThinkingConfig {
|
|
|
2724
2867
|
* Defines a tool that model can call to access external knowledge.
|
|
2725
2868
|
* @public
|
|
2726
2869
|
*/
|
|
2727
|
-
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool;
|
|
2870
|
+
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool;
|
|
2728
2871
|
|
|
2729
2872
|
/**
|
|
2730
2873
|
* Tool config. This config is shared for all tools provided in the request.
|
package/dist/ai.d.ts
CHANGED
|
@@ -436,6 +436,56 @@ export declare interface CitationMetadata {
|
|
|
436
436
|
citations: Citation[];
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
+
/**
|
|
440
|
+
* The results of code execution run by the model.
|
|
441
|
+
*
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
export declare interface CodeExecutionResult {
|
|
445
|
+
/**
|
|
446
|
+
* The result of the code execution.
|
|
447
|
+
*/
|
|
448
|
+
outcome?: Outcome;
|
|
449
|
+
/**
|
|
450
|
+
* The output from the code execution, or an error message
|
|
451
|
+
* if it failed.
|
|
452
|
+
*/
|
|
453
|
+
output?: string;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Represents the code execution result from the model.
|
|
458
|
+
*
|
|
459
|
+
* @public
|
|
460
|
+
*/
|
|
461
|
+
export declare interface CodeExecutionResultPart {
|
|
462
|
+
text?: never;
|
|
463
|
+
inlineData?: never;
|
|
464
|
+
functionCall?: never;
|
|
465
|
+
functionResponse?: never;
|
|
466
|
+
fileData: never;
|
|
467
|
+
thought?: never;
|
|
468
|
+
/**
|
|
469
|
+
* @internal
|
|
470
|
+
*/
|
|
471
|
+
thoughtSignature?: never;
|
|
472
|
+
executableCode?: never;
|
|
473
|
+
codeExecutionResult?: CodeExecutionResult;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* A tool that enables the model to use code execution.
|
|
478
|
+
*
|
|
479
|
+
* @public
|
|
480
|
+
*/
|
|
481
|
+
export declare interface CodeExecutionTool {
|
|
482
|
+
/**
|
|
483
|
+
* Specifies the Google Search configuration.
|
|
484
|
+
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
485
|
+
*/
|
|
486
|
+
codeExecution: {};
|
|
487
|
+
}
|
|
488
|
+
|
|
439
489
|
/**
|
|
440
490
|
* Content type for both prompts and response candidates.
|
|
441
491
|
* @public
|
|
@@ -573,6 +623,42 @@ export declare interface ErrorDetails {
|
|
|
573
623
|
[key: string]: unknown;
|
|
574
624
|
}
|
|
575
625
|
|
|
626
|
+
/**
|
|
627
|
+
* An interface for executable code returned by the model.
|
|
628
|
+
*
|
|
629
|
+
* @public
|
|
630
|
+
*/
|
|
631
|
+
export declare interface ExecutableCode {
|
|
632
|
+
/**
|
|
633
|
+
* The programming language of the code.
|
|
634
|
+
*/
|
|
635
|
+
language?: Language;
|
|
636
|
+
/**
|
|
637
|
+
* The source code to be executed.
|
|
638
|
+
*/
|
|
639
|
+
code?: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Represents the code that is executed by the model.
|
|
644
|
+
*
|
|
645
|
+
* @public
|
|
646
|
+
*/
|
|
647
|
+
export declare interface ExecutableCodePart {
|
|
648
|
+
text?: never;
|
|
649
|
+
inlineData?: never;
|
|
650
|
+
functionCall?: never;
|
|
651
|
+
functionResponse?: never;
|
|
652
|
+
fileData: never;
|
|
653
|
+
thought?: never;
|
|
654
|
+
/**
|
|
655
|
+
* @internal
|
|
656
|
+
*/
|
|
657
|
+
thoughtSignature?: never;
|
|
658
|
+
executableCode?: ExecutableCode;
|
|
659
|
+
codeExecutionResult?: never;
|
|
660
|
+
}
|
|
661
|
+
|
|
576
662
|
/**
|
|
577
663
|
* Data pointing to a file uploaded on Google Cloud Storage.
|
|
578
664
|
* @public
|
|
@@ -597,6 +683,8 @@ export declare interface FileDataPart {
|
|
|
597
683
|
* @internal
|
|
598
684
|
*/
|
|
599
685
|
thoughtSignature?: never;
|
|
686
|
+
executableCode?: never;
|
|
687
|
+
codeExecutionResult?: never;
|
|
600
688
|
}
|
|
601
689
|
|
|
602
690
|
/**
|
|
@@ -718,6 +806,8 @@ export declare interface FunctionCallPart {
|
|
|
718
806
|
* @internal
|
|
719
807
|
*/
|
|
720
808
|
thoughtSignature?: never;
|
|
809
|
+
executableCode?: never;
|
|
810
|
+
codeExecutionResult?: never;
|
|
721
811
|
}
|
|
722
812
|
|
|
723
813
|
/**
|
|
@@ -805,6 +895,8 @@ export declare interface FunctionResponsePart {
|
|
|
805
895
|
* @internal
|
|
806
896
|
*/
|
|
807
897
|
thoughtSignature?: never;
|
|
898
|
+
executableCode?: never;
|
|
899
|
+
codeExecutionResult?: never;
|
|
808
900
|
}
|
|
809
901
|
|
|
810
902
|
/**
|
|
@@ -1110,8 +1202,6 @@ export declare interface GoogleSearchTool {
|
|
|
1110
1202
|
/**
|
|
1111
1203
|
* Specifies the Google Search configuration.
|
|
1112
1204
|
* Currently, this is an empty object, but it's reserved for future configuration options.
|
|
1113
|
-
* Specifies the Google Search configuration. Currently, this is an empty object, but it's
|
|
1114
|
-
* reserved for future configuration options.
|
|
1115
1205
|
*
|
|
1116
1206
|
* When using this feature, you are required to comply with the "Grounding with Google Search"
|
|
1117
1207
|
* usage requirements for your chosen API provider: {@link https://ai.google.dev/gemini-api/terms#grounding-with-google-search | Gemini Developer API}
|
|
@@ -1822,17 +1912,36 @@ export declare interface ImagenSafetySettings {
|
|
|
1822
1912
|
/**
|
|
1823
1913
|
* <b>(EXPERIMENTAL)</b>
|
|
1824
1914
|
* Determines whether inference happens on-device or in-cloud.
|
|
1915
|
+
*
|
|
1916
|
+
* @remarks
|
|
1917
|
+
* <b>PREFER_ON_DEVICE:</b> Attempt to make inference calls using an
|
|
1918
|
+
* on-device model. If on-device inference is not available, the SDK
|
|
1919
|
+
* will fall back to using a cloud-hosted model.
|
|
1920
|
+
* <br/>
|
|
1921
|
+
* <b>ONLY_ON_DEVICE:</b> Only attempt to make inference calls using an
|
|
1922
|
+
* on-device model. The SDK will not fall back to a cloud-hosted model.
|
|
1923
|
+
* If on-device inference is not available, inference methods will throw.
|
|
1924
|
+
* <br/>
|
|
1925
|
+
* <b>ONLY_IN_CLOUD:</b> Only attempt to make inference calls using a
|
|
1926
|
+
* cloud-hosted model. The SDK will not fall back to an on-device model.
|
|
1927
|
+
* <br/>
|
|
1928
|
+
* <b>PREFER_IN_CLOUD:</b> Attempt to make inference calls to a
|
|
1929
|
+
* cloud-hosted model. If not available, the SDK will fall back to an
|
|
1930
|
+
* on-device model.
|
|
1931
|
+
*
|
|
1825
1932
|
* @public
|
|
1826
1933
|
*/
|
|
1827
1934
|
export declare const InferenceMode: {
|
|
1828
1935
|
readonly PREFER_ON_DEVICE: "prefer_on_device";
|
|
1829
1936
|
readonly ONLY_ON_DEVICE: "only_on_device";
|
|
1830
1937
|
readonly ONLY_IN_CLOUD: "only_in_cloud";
|
|
1938
|
+
readonly PREFER_IN_CLOUD: "prefer_in_cloud";
|
|
1831
1939
|
};
|
|
1832
1940
|
|
|
1833
1941
|
/**
|
|
1834
1942
|
* <b>(EXPERIMENTAL)</b>
|
|
1835
1943
|
* Determines whether inference happens on-device or in-cloud.
|
|
1944
|
+
*
|
|
1836
1945
|
* @public
|
|
1837
1946
|
*/
|
|
1838
1947
|
export declare type InferenceMode = (typeof InferenceMode)[keyof typeof InferenceMode];
|
|
@@ -1855,6 +1964,8 @@ export declare interface InlineDataPart {
|
|
|
1855
1964
|
* @internal
|
|
1856
1965
|
*/
|
|
1857
1966
|
thoughtSignature?: never;
|
|
1967
|
+
executableCode?: never;
|
|
1968
|
+
codeExecutionResult?: never;
|
|
1858
1969
|
}
|
|
1859
1970
|
|
|
1860
1971
|
/**
|
|
@@ -1865,6 +1976,23 @@ export declare class IntegerSchema extends Schema {
|
|
|
1865
1976
|
constructor(schemaParams?: SchemaParams);
|
|
1866
1977
|
}
|
|
1867
1978
|
|
|
1979
|
+
/**
|
|
1980
|
+
* The programming language of the code.
|
|
1981
|
+
*
|
|
1982
|
+
* @public
|
|
1983
|
+
*/
|
|
1984
|
+
export declare const Language: {
|
|
1985
|
+
UNSPECIFIED: string;
|
|
1986
|
+
PYTHON: string;
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* The programming language of the code.
|
|
1991
|
+
*
|
|
1992
|
+
* @public
|
|
1993
|
+
*/
|
|
1994
|
+
export declare type Language = (typeof Language)[keyof typeof Language];
|
|
1995
|
+
|
|
1868
1996
|
/**
|
|
1869
1997
|
* <b>(EXPERIMENTAL)</b>
|
|
1870
1998
|
* Configures the creation of an on-device language model session.
|
|
@@ -2301,12 +2429,31 @@ export declare interface OnDeviceParams {
|
|
|
2301
2429
|
promptOptions?: LanguageModelPromptOptions;
|
|
2302
2430
|
}
|
|
2303
2431
|
|
|
2432
|
+
/**
|
|
2433
|
+
* Represents the result of the code execution.
|
|
2434
|
+
*
|
|
2435
|
+
* @public
|
|
2436
|
+
*/
|
|
2437
|
+
export declare const Outcome: {
|
|
2438
|
+
UNSPECIFIED: string;
|
|
2439
|
+
OK: string;
|
|
2440
|
+
FAILED: string;
|
|
2441
|
+
DEADLINE_EXCEEDED: string;
|
|
2442
|
+
};
|
|
2443
|
+
|
|
2444
|
+
/**
|
|
2445
|
+
* Represents the result of the code execution.
|
|
2446
|
+
*
|
|
2447
|
+
* @public
|
|
2448
|
+
*/
|
|
2449
|
+
export declare type Outcome = (typeof Outcome)[keyof typeof Outcome];
|
|
2450
|
+
|
|
2304
2451
|
/**
|
|
2305
2452
|
* Content part - includes text, image/video, or function call/response
|
|
2306
2453
|
* part types.
|
|
2307
2454
|
* @public
|
|
2308
2455
|
*/
|
|
2309
|
-
export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart;
|
|
2456
|
+
export declare type Part = TextPart | InlineDataPart | FunctionCallPart | FunctionResponsePart | FileDataPart | ExecutableCodePart | CodeExecutionResultPart;
|
|
2310
2457
|
|
|
2311
2458
|
/**
|
|
2312
2459
|
* Possible roles.
|
|
@@ -2819,6 +2966,8 @@ export declare interface TextPart {
|
|
|
2819
2966
|
* @internal
|
|
2820
2967
|
*/
|
|
2821
2968
|
thoughtSignature?: string;
|
|
2969
|
+
executableCode?: never;
|
|
2970
|
+
codeExecutionResult?: never;
|
|
2822
2971
|
}
|
|
2823
2972
|
|
|
2824
2973
|
/**
|
|
@@ -2859,7 +3008,7 @@ export declare interface ThinkingConfig {
|
|
|
2859
3008
|
* Defines a tool that model can call to access external knowledge.
|
|
2860
3009
|
* @public
|
|
2861
3010
|
*/
|
|
2862
|
-
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool;
|
|
3011
|
+
export declare type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool;
|
|
2863
3012
|
|
|
2864
3013
|
/**
|
|
2865
3014
|
* Tool config. This config is shared for all tools provided in the request.
|