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

index.ts

224 lines6.5 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 BytePlusTTSAdapter,
51 byteplusSpeech,
52 createBytePlusSpeech,
53 toSpeechRate,
54} from './adapters/tts'
55export type {
56 BytePlusTTSProviderOptions,
57 BytePlusTTSResult,
58 BytePlusTTSVoice,
59} from './audio/tts-provider-options'
60export {
61 BytePlusTranscriptionAdapter,
62 byteplusTranscription,
63 createBytePlusTranscription,
64} from './adapters/transcription'
65export type { BytePlusTranscriptionWord } from './adapters/transcription'
66export type { BytePlusTranscriptionProviderOptions } from './audio/transcription-provider-options'
67export {
68 BYTEPLUS_ASR_RESOURCE_HEADER,
69 BYTEPLUS_ASR_RESOURCE_ID,
70 BYTEPLUS_TTS_SAMPLE_RATES,
71} from './audio/wire-types'
72export type {
73 BytePlusASRAudio,
74 BytePlusASRRecognizeRequest,
75 BytePlusASRRecognizeResponse,
76 BytePlusASRResult,
77 BytePlusASRUtterance,
78 BytePlusASRWord,
79 BytePlusTTSAudioConfig,
80 BytePlusTTSAudioFormat,
81 BytePlusTTSCreateRequest,
82 BytePlusTTSCreateResponse,
83 BytePlusTTSReference,
84 BytePlusTTSSampleRate,
85 BytePlusTTSSubtitle,
86 BytePlusTTSSubtitleEntry,
87 BytePlusVoiceErrorBody,
88} from './audio/wire-types'
89export {
90 BytePlusImageAdapter,
91 byteplusImage,
92 createBytePlusImage,
93} from './adapters/image'
94export type { BytePlusImageConfig } from './adapters/image'
95export {
96 BYTEPLUS_IMAGE_MAX_PROMPT_WORDS,
97 BYTEPLUS_IMAGE_MAX_SEQUENTIAL_IMAGES,
98 BYTEPLUS_OUTPUT_FORMAT_IMAGE_MODELS,
99 parseBytePlusImageSize,
100} from './image/image-provider-options'
101export type {
102 BytePlusImageBaseProviderOptions,
103 BytePlusImageModelInputModalitiesByName,
104 BytePlusImageModelProviderOptionsByName,
105 BytePlusImageProviderOptions,
106 BytePlusSeedream5ImageProviderOptions,
107 ParsedBytePlusImageSize,
108} from './image/image-provider-options'
109export type {
110 BytePlusImageData,
111 BytePlusImageErrorObject,
112 BytePlusImageGenerationRequest,
113 BytePlusImageGenerationResponse,
114 BytePlusImageOutputFormat,
115 BytePlusImageResponseFormat,
116 BytePlusImageUsage,
117 BytePlusOptimizePromptOptions,
118 BytePlusSequentialImageGeneration,
119 BytePlusSequentialImageGenerationOptions,
120} from './image/wire-types'
121​
122export {
123 BytePlusTextAdapter,
124 byteplusText,
125 createBytePlusText,
126} from './adapters/text'
127export type { BytePlusTextConfig } from './adapters/text'
128​
129export type {
130 BytePlusAudioMetadata,
131 BytePlusChatContentPart,
132 BytePlusDocumentMetadata,
133 BytePlusEncryptedContentFields,
134 BytePlusImageMetadata,
135 BytePlusImagePixelLimit,
136 BytePlusImageUrlContentPart,
137 BytePlusInputAudioContentPart,
138 BytePlusMessageMetadataByModality,
139 BytePlusStreamDeltaExtras,
140 BytePlusTextMetadata,
141 BytePlusVideoMetadata,
142 BytePlusVideoUrlContentPart,
143} from './message-types'
144​
145// ============================================================================
146// Client configuration
147// ============================================================================
148​
149export {
150 BYTEPLUS_ARK_BASE_URL,
151 BYTEPLUS_VOICE_BASE_URL,
152 bytePlusArkError,
153 bytePlusArkHeaders,
154 bytePlusVoiceError,
155 bytePlusVoiceHeaders,
156 getBytePlusArkApiKeyFromEnv,
157 getBytePlusVoiceApiKeyFromEnv,
158 withBytePlusArkDefaults,
159 withBytePlusVoiceDefaults,
160} from './utils/client'
161export type { BytePlusArkConfig, BytePlusVoiceConfig } from './utils/client'
162​
163// ============================================================================
164// Provider options
165// ============================================================================
166​
167export type {
168 BytePlusNamedToolChoice,
169 BytePlusReasoningEffort,
170 BytePlusServiceTier,
171 BytePlusTextProviderOptions,
172 BytePlusThinkingOption,
173 BytePlusToolChoice,
174} from './text/text-provider-options'
175​
176// ============================================================================
177// Model metadata
178// ============================================================================
179​
180export {
181 BYTEPLUS_CHAT_MODELS,
182 BYTEPLUS_IMAGE_MAX_REFERENCE_IMAGES,
183 BYTEPLUS_IMAGE_MODELS,
184 BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS,
185 BYTEPLUS_THINKING_SUMMARY_MODELS,
186 BYTEPLUS_TRANSCRIPTION_MODELS,
187 BYTEPLUS_TTS_MODELS,
188 BYTEPLUS_VIDEO_DURATIONS,
189 BYTEPLUS_VIDEO_FALLBACK_DURATIONS,
190 BYTEPLUS_VIDEO_MODELS,
191 emitsEncryptedContent,
192 getBytePlusVideoDurationOptions,
193 isKnownBytePlusVideoModel,
194 supportsStructuredOutput,
195} from './model-meta'
196export type {
197 BytePlusChatModel,
198 BytePlusChatModelProviderOptionsByName,
199 BytePlusChatModelStructuredOutputByName,
200 BytePlusChatModelToolCapabilitiesByName,
201 BytePlusImageModel,
202 BytePlusImageModelSizeByName,
203 BytePlusImageSize,
204 BytePlusImageSizeToken,
205 BytePlusModelInputModalitiesByName,
206 BytePlusProviderToolKind,
207 BytePlusStructuredOutputChatModel,
208 BytePlusThinkingSummaryModel,
209 BytePlusTranscriptionModel,
210 BytePlusTTSModel,
211 BytePlusVideoModel,
212 BytePlusVideoModelDurationByName,
213 BytePlusVideoModelInputModalitiesByName,
214 BytePlusVideoModelOrString,
215 BytePlusVideoModelResolutionByName,
216 BytePlusVideoModelSizeByName,
217 BytePlusVideoRatio,
218 BytePlusVideoResolution,
219 BytePlusVideoSize,
220 ResolveBytePlusVideoInputModalities,
221 ResolveBytePlusVideoSize,
222 ResolveInputModalities,
223 ResolveProviderOptions,
224} from './model-meta'