Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

index.ts

226 lines6.6 KB

1// ============================================================================
2// Adapters
3// ============================================================================
4//
5// Tree-shakeable adapters live in ./adapters and are re-exported here, one
6// block per generation kind:
7//
8// - text → ./adapters/text (Seed chat models on Ark)
9// - video → ./adapters/video (Seedance task API)
10// - image → ./adapters/image (Seedream)
11// - speech → ./adapters/tts (Seed Speech TTS)
12// - transcription → ./adapters/transcription (Seed Speech ASR)
13//
14export {
15 BytePlusVideoAdapter,
16 byteplusVideo,
17 createBytePlusVideo,
18} from './adapters/video'
19export type { BytePlusVideoConfig } from './adapters/video'
20export {
21 parseBytePlusVideoSize,
22 resolveBytePlusVideoResolution,
23 resolveBytePlusVideoSize,
24 supportsAudioOnlyReference,
25 supportsLastFrame,
26 supportsReferenceMedia,
27} from './video/video-provider-options'
28export type {
29 BytePlusVideoModelProviderOptionsByName,
30 BytePlusVideoOutputFormat,
31 BytePlusVideoProviderOptions,
32 BytePlusVideoServiceTier,
33} from './video/video-provider-options'
34export type {
35 BytePlusVideoContentPart,
36 BytePlusVideoContentRole,
37 BytePlusVideoCreateRequest,
38 BytePlusVideoCreateResponse,
39 BytePlusVideoTask,
40 BytePlusVideoTaskContent,
41 BytePlusVideoTaskError,
42 BytePlusVideoTaskListItem,
43 BytePlusVideoTaskListResponse,
44 BytePlusVideoTaskStatus,
45 BytePlusVideoTaskUsage,
46} from './video/wire-types'
47export {
48 BYTEPLUS_DEFAULT_TTS_SPEAKER,
49 BYTEPLUS_TTS_MAX_OUTPUT_SECONDS,
50 BYTEPLUS_TTS_MAX_REFERENCES,
51 BytePlusTTSAdapter,
52 byteplusSpeech,
53 createBytePlusSpeech,
54 toSpeechRate,
55} from './adapters/tts'
56export type {
57 BytePlusTTSProviderOptions,
58 BytePlusTTSResult,
59 BytePlusTTSVoice,
60} from './audio/tts-provider-options'
61export {
62 BytePlusTranscriptionAdapter,
63 byteplusTranscription,
64 createBytePlusTranscription,
65} from './adapters/transcription'
66export type { BytePlusTranscriptionWord } from './adapters/transcription'
67export type { BytePlusTranscriptionProviderOptions } from './audio/transcription-provider-options'
68export {
69 BYTEPLUS_ASR_RESOURCE_HEADER,
70 BYTEPLUS_ASR_RESOURCE_ID,
71 BYTEPLUS_TTS_SAMPLE_RATES,
72} from './audio/wire-types'
73export type {
74 BytePlusASRAudio,
75 BytePlusASRRecognizeRequest,
76 BytePlusASRRecognizeResponse,
77 BytePlusASRResult,
78 BytePlusASRUtterance,
79 BytePlusASRWord,
80 BytePlusTTSAudioConfig,
81 BytePlusTTSAudioFormat,
82 BytePlusTTSCreateRequest,
83 BytePlusTTSCreateResponse,
84 BytePlusTTSReference,
85 BytePlusTTSSampleRate,
86 BytePlusTTSSubtitle,
87 BytePlusTTSSubtitleEntry,
88 BytePlusTTSWatermark,
89 BytePlusVoiceErrorBody,
90} from './audio/wire-types'
91export {
92 BytePlusImageAdapter,
93 byteplusImage,
94 createBytePlusImage,
95} from './adapters/image'
96export type { BytePlusImageConfig } from './adapters/image'
97export {
98 BYTEPLUS_IMAGE_MAX_PROMPT_WORDS,
99 BYTEPLUS_IMAGE_MAX_SEQUENTIAL_IMAGES,
100 BYTEPLUS_OUTPUT_FORMAT_IMAGE_MODELS,
101 parseBytePlusImageSize,
102} from './image/image-provider-options'
103export type {
104 BytePlusImageBaseProviderOptions,
105 BytePlusImageModelInputModalitiesByName,
106 BytePlusImageModelProviderOptionsByName,
107 BytePlusImageProviderOptions,
108 BytePlusSeedream5ImageProviderOptions,
109 ParsedBytePlusImageSize,
110} from './image/image-provider-options'
111export type {
112 BytePlusImageData,
113 BytePlusImageErrorObject,
114 BytePlusImageGenerationRequest,
115 BytePlusImageGenerationResponse,
116 BytePlusImageOutputFormat,
117 BytePlusImageResponseFormat,
118 BytePlusImageUsage,
119 BytePlusOptimizePromptOptions,
120 BytePlusSequentialImageGeneration,
121 BytePlusSequentialImageGenerationOptions,
122} from './image/wire-types'
123​
124export {
125 BytePlusTextAdapter,
126 byteplusText,
127 createBytePlusText,
128} from './adapters/text'
129export type { BytePlusTextConfig } from './adapters/text'
130​
131export type {
132 BytePlusAudioMetadata,
133 BytePlusChatContentPart,
134 BytePlusDocumentMetadata,
135 BytePlusEncryptedContentFields,
136 BytePlusImageMetadata,
137 BytePlusImagePixelLimit,
138 BytePlusImageUrlContentPart,
139 BytePlusInputAudioContentPart,
140 BytePlusMessageMetadataByModality,
141 BytePlusStreamDeltaExtras,
142 BytePlusTextMetadata,
143 BytePlusVideoMetadata,
144 BytePlusVideoUrlContentPart,
145} from './message-types'
146​
147// ============================================================================
148// Client configuration
149// ============================================================================
150​
151export {
152 BYTEPLUS_ARK_BASE_URL,
153 BYTEPLUS_VOICE_BASE_URL,
154 bytePlusArkError,
155 bytePlusArkHeaders,
156 bytePlusVoiceError,
157 bytePlusVoiceHeaders,
158 getBytePlusArkApiKeyFromEnv,
159 getBytePlusVoiceApiKeyFromEnv,
160 withBytePlusArkDefaults,
161 withBytePlusVoiceDefaults,
162} from './utils/client'
163export type { BytePlusArkConfig, BytePlusVoiceConfig } from './utils/client'
164​
165// ============================================================================
166// Provider options
167// ============================================================================
168​
169export type {
170 BytePlusNamedToolChoice,
171 BytePlusReasoningEffort,
172 BytePlusServiceTier,
173 BytePlusTextProviderOptions,
174 BytePlusThinkingOption,
175 BytePlusToolChoice,
176} from './text/text-provider-options'
177​
178// ============================================================================
179// Model metadata
180// ============================================================================
181​
182export {
183 BYTEPLUS_CHAT_MODELS,
184 BYTEPLUS_IMAGE_MAX_REFERENCE_IMAGES,
185 BYTEPLUS_IMAGE_MODELS,
186 BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS,
187 BYTEPLUS_THINKING_SUMMARY_MODELS,
188 BYTEPLUS_TRANSCRIPTION_MODELS,
189 BYTEPLUS_TTS_MODELS,
190 BYTEPLUS_VIDEO_DURATIONS,
191 BYTEPLUS_VIDEO_FALLBACK_DURATIONS,
192 BYTEPLUS_VIDEO_MODELS,
193 emitsEncryptedContent,
194 getBytePlusVideoDurationOptions,
195 isKnownBytePlusVideoModel,
196 supportsStructuredOutput,
197} from './model-meta'
198export type {
199 BytePlusChatModel,
200 BytePlusChatModelProviderOptionsByName,
201 BytePlusChatModelStructuredOutputByName,
202 BytePlusChatModelToolCapabilitiesByName,
203 BytePlusImageModel,
204 BytePlusImageModelSizeByName,
205 BytePlusImageSize,
206 BytePlusImageSizeToken,
207 BytePlusModelInputModalitiesByName,
208 BytePlusProviderToolKind,
209 BytePlusStructuredOutputChatModel,
210 BytePlusThinkingSummaryModel,
211 BytePlusTranscriptionModel,
212 BytePlusTTSModel,
213 BytePlusVideoModel,
214 BytePlusVideoModelDurationByName,
215 BytePlusVideoModelInputModalitiesByName,
216 BytePlusVideoModelOrString,
217 BytePlusVideoModelResolutionByName,
218 BytePlusVideoModelSizeByName,
219 BytePlusVideoRatio,
220 BytePlusVideoResolution,
221 BytePlusVideoSize,
222 ResolveBytePlusVideoInputModalities,
223 ResolveBytePlusVideoSize,
224 ResolveInputModalities,
225 ResolveProviderOptions,
226} from './model-meta'