@tanstack/ai-gemini 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/dist/esm/adapters/audio.js +113 -61
- package/dist/esm/adapters/audio.js.map +1 -1
- package/dist/esm/adapters/image.js +224 -225
- package/dist/esm/adapters/image.js.map +1 -1
- package/dist/esm/adapters/summarize.js +33 -12
- package/dist/esm/adapters/summarize.js.map +1 -1
- package/dist/esm/adapters/text.js +574 -650
- package/dist/esm/adapters/text.js.map +1 -1
- package/dist/esm/adapters/tts.js +197 -178
- package/dist/esm/adapters/tts.js.map +1 -1
- package/dist/esm/adapters/video.js +456 -409
- package/dist/esm/adapters/video.js.map +1 -1
- package/dist/esm/experimental/index.js +1 -6
- package/dist/esm/experimental/text-interactions/adapter.js +877 -1014
- package/dist/esm/experimental/text-interactions/adapter.js.map +1 -1
- package/dist/esm/image/image-provider-options.js +74 -54
- package/dist/esm/image/image-provider-options.js.map +1 -1
- package/dist/esm/index.js +4 -36
- package/dist/esm/model-meta.d.ts +53 -5
- package/dist/esm/model-meta.js +733 -129
- package/dist/esm/model-meta.js.map +1 -1
- package/dist/esm/realtime/adapter.js +242 -228
- package/dist/esm/realtime/adapter.js.map +1 -1
- package/dist/esm/realtime/client.js +314 -381
- package/dist/esm/realtime/client.js.map +1 -1
- package/dist/esm/realtime/index.js +3 -0
- package/dist/esm/realtime/token.js +50 -36
- package/dist/esm/realtime/token.js.map +1 -1
- package/dist/esm/realtime/utils.js +202 -245
- package/dist/esm/realtime/utils.js.map +1 -1
- package/dist/esm/tools/code-execution-tool.js +11 -13
- package/dist/esm/tools/code-execution-tool.js.map +1 -1
- package/dist/esm/tools/computer-use-tool.js +18 -28
- package/dist/esm/tools/computer-use-tool.js.map +1 -1
- package/dist/esm/tools/file-search-tool.js +11 -14
- package/dist/esm/tools/file-search-tool.js.map +1 -1
- package/dist/esm/tools/function-declaration-tool.js +11 -25
- package/dist/esm/tools/function-declaration-tool.js.map +1 -1
- package/dist/esm/tools/google-maps-tool.js +11 -14
- package/dist/esm/tools/google-maps-tool.js.map +1 -1
- package/dist/esm/tools/google-search-retriveal-tool.js +11 -14
- package/dist/esm/tools/google-search-retriveal-tool.js.map +1 -1
- package/dist/esm/tools/google-search-tool.js +11 -14
- package/dist/esm/tools/google-search-tool.js.map +1 -1
- package/dist/esm/tools/index.js +2 -13
- package/dist/esm/tools/tool-converter.js +64 -57
- package/dist/esm/tools/tool-converter.js.map +1 -1
- package/dist/esm/tools/url-context-tool.js +11 -13
- package/dist/esm/tools/url-context-tool.js.map +1 -1
- package/dist/esm/usage.js +81 -87
- package/dist/esm/usage.js.map +1 -1
- package/dist/esm/utils/client.js +31 -24
- package/dist/esm/utils/client.js.map +1 -1
- package/dist/esm/utils/index.js +2 -0
- package/dist/esm/video/video-provider-options.js +73 -20
- package/dist/esm/video/video-provider-options.js.map +1 -1
- package/package.json +7 -7
- package/src/model-meta.ts +120 -10
- package/dist/esm/experimental/index.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/tools/index.js.map +0 -1
package/src/model-meta.ts
CHANGED
|
@@ -743,6 +743,48 @@ const GEMINI_OMNI_FLASH_PREVIEW = {
|
|
|
743
743
|
GeminiCachedContentOptions
|
|
744
744
|
>
|
|
745
745
|
|
|
746
|
+
const GEMINI_3_6_FLASH = {
|
|
747
|
+
name: 'gemini-3.6-flash',
|
|
748
|
+
max_input_tokens: 1_048_576,
|
|
749
|
+
max_output_tokens: 65_536,
|
|
750
|
+
knowledge_cutoff: '2026-03-01',
|
|
751
|
+
supports: {
|
|
752
|
+
input: ['text', 'image', 'video', 'audio', 'document'],
|
|
753
|
+
output: ['text'],
|
|
754
|
+
capabilities: [
|
|
755
|
+
'batch_api',
|
|
756
|
+
'caching',
|
|
757
|
+
'function_calling',
|
|
758
|
+
'structured_output',
|
|
759
|
+
'thinking',
|
|
760
|
+
],
|
|
761
|
+
tools: [
|
|
762
|
+
'code_execution',
|
|
763
|
+
'file_search',
|
|
764
|
+
'google_search',
|
|
765
|
+
'google_maps',
|
|
766
|
+
'url_context',
|
|
767
|
+
'computer_use',
|
|
768
|
+
],
|
|
769
|
+
},
|
|
770
|
+
pricing: {
|
|
771
|
+
input: {
|
|
772
|
+
normal: 1.5,
|
|
773
|
+
cached: 0.15,
|
|
774
|
+
},
|
|
775
|
+
output: {
|
|
776
|
+
normal: 7.5,
|
|
777
|
+
},
|
|
778
|
+
},
|
|
779
|
+
} as const satisfies ModelMeta<
|
|
780
|
+
GeminiToolConfigOptions &
|
|
781
|
+
GeminiSafetyOptions &
|
|
782
|
+
GeminiCommonConfigOptions &
|
|
783
|
+
GeminiCachedContentOptions &
|
|
784
|
+
GeminiStructuredOutputOptions &
|
|
785
|
+
GeminiThinkingOptions
|
|
786
|
+
>
|
|
787
|
+
|
|
746
788
|
const GEMINI_3_5_FLASH = {
|
|
747
789
|
name: 'gemini-3.5-flash',
|
|
748
790
|
max_input_tokens: 1_048_576,
|
|
@@ -757,7 +799,14 @@ const GEMINI_3_5_FLASH = {
|
|
|
757
799
|
'structured_output',
|
|
758
800
|
'thinking',
|
|
759
801
|
],
|
|
760
|
-
tools: [
|
|
802
|
+
tools: [
|
|
803
|
+
'code_execution',
|
|
804
|
+
'file_search',
|
|
805
|
+
'google_search',
|
|
806
|
+
'google_maps',
|
|
807
|
+
'url_context',
|
|
808
|
+
'computer_use',
|
|
809
|
+
],
|
|
761
810
|
},
|
|
762
811
|
pricing: {
|
|
763
812
|
input: {
|
|
@@ -777,8 +826,51 @@ const GEMINI_3_5_FLASH = {
|
|
|
777
826
|
GeminiThinkingOptions
|
|
778
827
|
>
|
|
779
828
|
|
|
829
|
+
const GEMINI_3_5_FLASH_LITE = {
|
|
830
|
+
name: 'gemini-3.5-flash-lite',
|
|
831
|
+
max_input_tokens: 1_048_576,
|
|
832
|
+
max_output_tokens: 65_536,
|
|
833
|
+
knowledge_cutoff: '2025-01-01',
|
|
834
|
+
supports: {
|
|
835
|
+
input: ['text', 'image', 'video', 'audio', 'document'],
|
|
836
|
+
output: ['text'],
|
|
837
|
+
capabilities: [
|
|
838
|
+
'batch_api',
|
|
839
|
+
'caching',
|
|
840
|
+
'function_calling',
|
|
841
|
+
'structured_output',
|
|
842
|
+
'thinking',
|
|
843
|
+
],
|
|
844
|
+
tools: [
|
|
845
|
+
'code_execution',
|
|
846
|
+
'file_search',
|
|
847
|
+
'google_search',
|
|
848
|
+
'google_maps',
|
|
849
|
+
'url_context',
|
|
850
|
+
],
|
|
851
|
+
},
|
|
852
|
+
pricing: {
|
|
853
|
+
input: {
|
|
854
|
+
normal: 0.3,
|
|
855
|
+
cached: 0.03,
|
|
856
|
+
},
|
|
857
|
+
output: {
|
|
858
|
+
normal: 2.5,
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
} as const satisfies ModelMeta<
|
|
862
|
+
GeminiToolConfigOptions &
|
|
863
|
+
GeminiSafetyOptions &
|
|
864
|
+
GeminiCommonConfigOptions &
|
|
865
|
+
GeminiCachedContentOptions &
|
|
866
|
+
GeminiStructuredOutputOptions &
|
|
867
|
+
GeminiThinkingOptions
|
|
868
|
+
>
|
|
869
|
+
|
|
780
870
|
export const GEMINI_MODELS = [
|
|
871
|
+
GEMINI_3_6_FLASH.name,
|
|
781
872
|
GEMINI_3_5_FLASH.name,
|
|
873
|
+
GEMINI_3_5_FLASH_LITE.name,
|
|
782
874
|
GEMINI_3_1_PRO.name,
|
|
783
875
|
GEMINI_3_FLASH.name,
|
|
784
876
|
GEMINI_3_1_FLASH_LITE.name,
|
|
@@ -796,11 +888,13 @@ export const GEMINI_MODELS = [
|
|
|
796
888
|
* brittle and keeps the engine's legacy finalization fallback.
|
|
797
889
|
*/
|
|
798
890
|
export const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
891
|
+
GEMINI_3_6_FLASH.name,
|
|
892
|
+
GEMINI_3_5_FLASH.name,
|
|
893
|
+
GEMINI_3_5_FLASH_LITE.name,
|
|
799
894
|
GEMINI_3_1_PRO.name,
|
|
800
895
|
GEMINI_3_FLASH.name,
|
|
801
896
|
GEMINI_3_1_FLASH_LITE.name,
|
|
802
897
|
GEMINI_3_1_FLASH_LITE_PREVIEW.name,
|
|
803
|
-
GEMINI_3_5_FLASH.name,
|
|
804
898
|
])
|
|
805
899
|
|
|
806
900
|
export type GeminiModels = (typeof GEMINI_MODELS)[number]
|
|
@@ -900,6 +994,24 @@ export const GEMINI_INTERACTIONS_VIDEO_MODELS = [
|
|
|
900
994
|
// Manual type map for per-model provider options
|
|
901
995
|
export type GeminiChatModelProviderOptionsByName = {
|
|
902
996
|
// Models with thinking and structured output support
|
|
997
|
+
[GEMINI_3_6_FLASH.name]: GeminiToolConfigOptions &
|
|
998
|
+
GeminiSafetyOptions &
|
|
999
|
+
GeminiCommonConfigOptions &
|
|
1000
|
+
GeminiCachedContentOptions &
|
|
1001
|
+
GeminiStructuredOutputOptions &
|
|
1002
|
+
GeminiThinkingOptions
|
|
1003
|
+
[GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &
|
|
1004
|
+
GeminiSafetyOptions &
|
|
1005
|
+
GeminiCommonConfigOptions &
|
|
1006
|
+
GeminiCachedContentOptions &
|
|
1007
|
+
GeminiStructuredOutputOptions &
|
|
1008
|
+
GeminiThinkingOptions
|
|
1009
|
+
[GEMINI_3_5_FLASH_LITE.name]: GeminiToolConfigOptions &
|
|
1010
|
+
GeminiSafetyOptions &
|
|
1011
|
+
GeminiCommonConfigOptions &
|
|
1012
|
+
GeminiCachedContentOptions &
|
|
1013
|
+
GeminiStructuredOutputOptions &
|
|
1014
|
+
GeminiThinkingOptions
|
|
903
1015
|
[GEMINI_3_1_PRO.name]: GeminiToolConfigOptions &
|
|
904
1016
|
GeminiSafetyOptions &
|
|
905
1017
|
GeminiCommonConfigOptions &
|
|
@@ -942,12 +1054,6 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
942
1054
|
GeminiCachedContentOptions &
|
|
943
1055
|
GeminiStructuredOutputOptions &
|
|
944
1056
|
GeminiThinkingOptions
|
|
945
|
-
[GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &
|
|
946
|
-
GeminiSafetyOptions &
|
|
947
|
-
GeminiCommonConfigOptions &
|
|
948
|
-
GeminiCachedContentOptions &
|
|
949
|
-
GeminiStructuredOutputOptions &
|
|
950
|
-
GeminiThinkingOptions
|
|
951
1057
|
}
|
|
952
1058
|
|
|
953
1059
|
/**
|
|
@@ -955,6 +1061,9 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
955
1061
|
* Based on the 'supports.tools' arrays defined for each model.
|
|
956
1062
|
*/
|
|
957
1063
|
export type GeminiChatModelToolCapabilitiesByName = {
|
|
1064
|
+
[GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.tools
|
|
1065
|
+
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools
|
|
1066
|
+
[GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.tools
|
|
958
1067
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools
|
|
959
1068
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools
|
|
960
1069
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools
|
|
@@ -962,7 +1071,6 @@ export type GeminiChatModelToolCapabilitiesByName = {
|
|
|
962
1071
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools
|
|
963
1072
|
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools
|
|
964
1073
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools
|
|
965
|
-
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools
|
|
966
1074
|
}
|
|
967
1075
|
|
|
968
1076
|
/**
|
|
@@ -980,13 +1088,15 @@ export type GeminiChatModelToolCapabilitiesByName = {
|
|
|
980
1088
|
*/
|
|
981
1089
|
export type GeminiModelInputModalitiesByName = {
|
|
982
1090
|
// Models with full multimodal support (text, image, audio, video, document)
|
|
1091
|
+
[GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.input
|
|
1092
|
+
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input
|
|
1093
|
+
[GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.input
|
|
983
1094
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input
|
|
984
1095
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input
|
|
985
1096
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input
|
|
986
1097
|
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input
|
|
987
1098
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input
|
|
988
1099
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input
|
|
989
|
-
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input
|
|
990
1100
|
|
|
991
1101
|
// Models with text, image, audio, video (no document)
|
|
992
1102
|
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|