@ai-sdk/fal 3.0.0-beta.3 → 3.0.0-beta.31
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/CHANGELOG.md +247 -8
- package/README.md +2 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.js +308 -238
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/fal-config.ts +2 -2
- package/src/{fal-image-options.ts → fal-image-model-options.ts} +5 -1
- package/src/fal-image-model.ts +30 -13
- package/src/fal-provider.ts +18 -18
- package/src/fal-speech-model-options.ts +21 -0
- package/src/fal-speech-model.ts +28 -30
- package/src/fal-transcription-model-options.ts +43 -0
- package/src/fal-transcription-model.ts +31 -55
- package/src/fal-video-model-options.ts +39 -0
- package/src/fal-video-model.ts +13 -48
- package/src/index.ts +4 -4
- package/dist/index.d.mts +0 -156
- package/dist/index.mjs +0 -1126
- package/dist/index.mjs.map +0 -1
package/dist/index.d.mts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { ProviderV3, ImageModelV3, TranscriptionModelV3, Experimental_VideoModelV3, SpeechModelV3 } from '@ai-sdk/provider';
|
|
2
|
-
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
-
import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
|
|
4
|
-
import { z } from 'zod/v4';
|
|
5
|
-
|
|
6
|
-
type FalImageModelId = 'fal-ai/aura-sr' | 'fal-ai/bria/background/remove' | 'fal-ai/bria/eraser' | 'fal-ai/bria/product-shot' | 'fal-ai/bria/reimagine' | 'bria/text-to-image/3.2' | 'fal-ai/bria/text-to-image/base' | 'fal-ai/bria/text-to-image/fast' | 'fal-ai/bria/text-to-image/hd' | 'fal-ai/bytedance/dreamina/v3.1/text-to-image' | 'fal-ai/ccsr' | 'fal-ai/clarity-upscaler' | 'fal-ai/creative-upscaler' | 'fal-ai/esrgan' | 'fal-ai/flux-general' | 'fal-ai/flux-general/differential-diffusion' | 'fal-ai/flux-general/image-to-image' | 'fal-ai/flux-general/inpainting' | 'fal-ai/flux-general/rf-inversion' | 'fal-ai/flux-kontext-lora/text-to-image' | 'fal-ai/flux-lora' | 'fal-ai/flux-lora/image-to-image' | 'fal-ai/flux-lora/inpainting' | 'fal-ai/flux-pro/kontext' | 'fal-ai/flux-pro/kontext/max' | 'fal-ai/flux-pro/v1.1' | 'fal-ai/flux-pro/v1.1-ultra' | 'fal-ai/flux-pro/v1.1-ultra-finetuned' | 'fal-ai/flux-pro/v1.1-ultra/redux' | 'fal-ai/flux-pro/v1.1/redux' | 'fal-ai/flux/dev' | 'fal-ai/flux/dev/image-to-image' | 'fal-ai/flux/dev/redux' | 'fal-ai/flux/krea' | 'fal-ai/flux/krea/image-to-image' | 'fal-ai/flux/krea/redux' | 'fal-ai/flux/schnell' | 'fal-ai/flux/schnell/redux' | 'fal-ai/ideogram/character' | 'fal-ai/ideogram/character/edit' | 'fal-ai/ideogram/character/remix' | 'fal-ai/imagen4/preview' | 'fal-ai/luma-photon' | 'fal-ai/luma-photon/flash' | 'fal-ai/object-removal' | 'fal-ai/omnigen-v2' | 'fal-ai/qwen-image' | 'fal-ai/recraft/v3/text-to-image' | 'fal-ai/recraft/v3/image-to-image' | 'fal-ai/sana/sprint' | 'fal-ai/sana/v1.5/4.8b' | 'fal-ai/sana/v1.5/1.6b' | 'fal-ai/sky-raccoon' | 'fal-ai/wan/v2.2-5b/text-to-image' | 'fal-ai/wan/v2.2-a14b/text-to-image' | 'fal-ai/fashn/tryon/v1.6' | (string & {});
|
|
7
|
-
|
|
8
|
-
type FalTranscriptionModelId = 'whisper' | 'wizper' | (string & {});
|
|
9
|
-
|
|
10
|
-
type FalSpeechModelId = 'fal-ai/minimax/voice-clone' | 'fal-ai/minimax/voice-design' | 'fal-ai/dia-tts/voice-clone' | 'fal-ai/minimax/speech-02-hd' | 'fal-ai/minimax/speech-02-turbo' | 'fal-ai/dia-tts' | 'resemble-ai/chatterboxhd/text-to-speech' | (string & {});
|
|
11
|
-
|
|
12
|
-
type FalVideoModelId = 'luma-dream-machine' | 'luma-ray-2' | 'luma-ray-2-flash' | 'minimax-video' | 'minimax-video-01' | 'hunyuan-video' | (string & {});
|
|
13
|
-
|
|
14
|
-
interface FalProviderSettings {
|
|
15
|
-
/**
|
|
16
|
-
* fal.ai API key. Default value is taken from the `FAL_API_KEY` environment
|
|
17
|
-
* variable, falling back to `FAL_KEY`.
|
|
18
|
-
*/
|
|
19
|
-
apiKey?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Base URL for the API calls.
|
|
22
|
-
* The default prefix is `https://fal.run`.
|
|
23
|
-
*/
|
|
24
|
-
baseURL?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Custom headers to include in the requests.
|
|
27
|
-
*/
|
|
28
|
-
headers?: Record<string, string>;
|
|
29
|
-
/**
|
|
30
|
-
* Custom fetch implementation. You can use it as a middleware to intercept
|
|
31
|
-
* requests, or to provide a custom fetch implementation for e.g. testing.
|
|
32
|
-
*/
|
|
33
|
-
fetch?: FetchFunction;
|
|
34
|
-
}
|
|
35
|
-
interface FalProvider extends ProviderV3 {
|
|
36
|
-
/**
|
|
37
|
-
* Creates a model for image generation.
|
|
38
|
-
*/
|
|
39
|
-
image(modelId: FalImageModelId): ImageModelV3;
|
|
40
|
-
/**
|
|
41
|
-
* Creates a model for image generation.
|
|
42
|
-
*/
|
|
43
|
-
imageModel(modelId: FalImageModelId): ImageModelV3;
|
|
44
|
-
/**
|
|
45
|
-
* Creates a model for transcription.
|
|
46
|
-
*/
|
|
47
|
-
transcription(modelId: FalTranscriptionModelId): TranscriptionModelV3;
|
|
48
|
-
/**
|
|
49
|
-
* Creates a model for video generation.
|
|
50
|
-
*/
|
|
51
|
-
video(modelId: FalVideoModelId): Experimental_VideoModelV3;
|
|
52
|
-
/**
|
|
53
|
-
* Creates a model for video generation.
|
|
54
|
-
*/
|
|
55
|
-
videoModel(modelId: FalVideoModelId): Experimental_VideoModelV3;
|
|
56
|
-
/**
|
|
57
|
-
* Creates a model for speech generation.
|
|
58
|
-
*/
|
|
59
|
-
speech(modelId: FalSpeechModelId): SpeechModelV3;
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use `embeddingModel` instead.
|
|
62
|
-
*/
|
|
63
|
-
textEmbeddingModel(modelId: string): never;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Create a fal.ai provider instance.
|
|
67
|
-
*/
|
|
68
|
-
declare function createFal(options?: FalProviderSettings): FalProvider;
|
|
69
|
-
/**
|
|
70
|
-
* Default fal.ai provider instance.
|
|
71
|
-
*/
|
|
72
|
-
declare const fal: FalProvider;
|
|
73
|
-
|
|
74
|
-
declare const falImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<Record<string, unknown>>;
|
|
75
|
-
type FalImageModelOptions = InferSchema<typeof falImageModelOptionsSchema>;
|
|
76
|
-
|
|
77
|
-
declare const falSpeechModelOptionsSchema: z.ZodObject<{
|
|
78
|
-
voice_setting: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
79
|
-
speed: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
80
|
-
vol: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
81
|
-
voice_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
82
|
-
pitch: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
83
|
-
english_normalization: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
84
|
-
emotion: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
85
|
-
happy: "happy";
|
|
86
|
-
sad: "sad";
|
|
87
|
-
angry: "angry";
|
|
88
|
-
fearful: "fearful";
|
|
89
|
-
disgusted: "disgusted";
|
|
90
|
-
surprised: "surprised";
|
|
91
|
-
neutral: "neutral";
|
|
92
|
-
}>>>>;
|
|
93
|
-
}, z.core.$strip>>>;
|
|
94
|
-
audio_setting: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
95
|
-
language_boost: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
96
|
-
Chinese: "Chinese";
|
|
97
|
-
"Chinese,Yue": "Chinese,Yue";
|
|
98
|
-
English: "English";
|
|
99
|
-
Arabic: "Arabic";
|
|
100
|
-
Russian: "Russian";
|
|
101
|
-
Spanish: "Spanish";
|
|
102
|
-
French: "French";
|
|
103
|
-
Portuguese: "Portuguese";
|
|
104
|
-
German: "German";
|
|
105
|
-
Turkish: "Turkish";
|
|
106
|
-
Dutch: "Dutch";
|
|
107
|
-
Ukrainian: "Ukrainian";
|
|
108
|
-
Vietnamese: "Vietnamese";
|
|
109
|
-
Indonesian: "Indonesian";
|
|
110
|
-
Japanese: "Japanese";
|
|
111
|
-
Italian: "Italian";
|
|
112
|
-
Korean: "Korean";
|
|
113
|
-
Thai: "Thai";
|
|
114
|
-
Polish: "Polish";
|
|
115
|
-
Romanian: "Romanian";
|
|
116
|
-
Greek: "Greek";
|
|
117
|
-
Czech: "Czech";
|
|
118
|
-
Finnish: "Finnish";
|
|
119
|
-
Hindi: "Hindi";
|
|
120
|
-
auto: "auto";
|
|
121
|
-
}>>>;
|
|
122
|
-
pronunciation_dict: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
123
|
-
}, z.core.$loose>;
|
|
124
|
-
type FalSpeechModelOptions = z.infer<typeof falSpeechModelOptionsSchema>;
|
|
125
|
-
|
|
126
|
-
declare const falTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
127
|
-
language: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
128
|
-
en: "en";
|
|
129
|
-
}>, z.ZodString]>>>>;
|
|
130
|
-
diarize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
131
|
-
chunkLevel: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
132
|
-
segment: "segment";
|
|
133
|
-
word: "word";
|
|
134
|
-
}>>>>;
|
|
135
|
-
version: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
|
-
3: "3";
|
|
137
|
-
}>>>>;
|
|
138
|
-
batchSize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
139
|
-
numSpeakers: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodNumber>>>;
|
|
140
|
-
}, z.core.$strip>;
|
|
141
|
-
type FalTranscriptionModelOptions = z.infer<typeof falTranscriptionModelOptionsSchema>;
|
|
142
|
-
|
|
143
|
-
type FalVideoModelOptions = {
|
|
144
|
-
loop?: boolean | null;
|
|
145
|
-
motionStrength?: number | null;
|
|
146
|
-
pollIntervalMs?: number | null;
|
|
147
|
-
pollTimeoutMs?: number | null;
|
|
148
|
-
resolution?: string | null;
|
|
149
|
-
negativePrompt?: string | null;
|
|
150
|
-
promptOptimizer?: boolean | null;
|
|
151
|
-
[key: string]: unknown;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
declare const VERSION: string;
|
|
155
|
-
|
|
156
|
-
export { type FalImageModelOptions, type FalImageModelOptions as FalImageProviderOptions, type FalProvider, type FalProviderSettings, type FalSpeechModelOptions, type FalTranscriptionModelOptions, type FalVideoModelId, type FalVideoModelOptions, type FalVideoModelOptions as FalVideoProviderOptions, VERSION, createFal, fal };
|