@shop-os/modelkit 0.4.7 → 0.5.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/CHANGELOG.md +57 -0
- package/README.md +18 -5
- package/dist/catalog.cjs +5513 -592
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +438 -33
- package/dist/catalog.d.ts +438 -33
- package/dist/catalog.js +5521 -600
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +9598 -3144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +402 -24
- package/dist/index.d.ts +402 -24
- package/dist/index.js +9593 -3144
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ type MediaRef = {
|
|
|
34
34
|
/** Measured length of a video/audio; the kit never measures it. */
|
|
35
35
|
durationSeconds?: number;
|
|
36
36
|
};
|
|
37
|
+
/** A click on the image for `mask` rows, in source pixels; `background` excludes the spot. */
|
|
38
|
+
interface MaskPoint {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
label?: "foreground" | "background";
|
|
42
|
+
}
|
|
43
|
+
/** A box around the object to mask, in source pixels. */
|
|
44
|
+
interface MaskBox {
|
|
45
|
+
xMin: number;
|
|
46
|
+
yMin: number;
|
|
47
|
+
xMax: number;
|
|
48
|
+
yMax: number;
|
|
49
|
+
}
|
|
37
50
|
/** Caller-driven Topaz upscale controls; see the topaz row and TopazImageInput. */
|
|
38
51
|
interface UpscaleOptions {
|
|
39
52
|
enhanceModel?: string;
|
|
@@ -42,13 +55,28 @@ interface UpscaleOptions {
|
|
|
42
55
|
faceEnhancementCreativity?: number;
|
|
43
56
|
faceEnhancementStrength?: number;
|
|
44
57
|
}
|
|
45
|
-
type ModelType = "text" | "image" | "video" | "audio"
|
|
46
|
-
/**
|
|
47
|
-
| "
|
|
58
|
+
type ModelType = "text" | "image" | "video" | "audio"
|
|
59
|
+
/** Sound effects (`generateAudio`): a text description, or a `sourceVideo` to score when the row requires one. */
|
|
60
|
+
| "sound-effect" | "upscale" | "bg-remove"
|
|
61
|
+
/** Image segmentation (`generateImage`): one image and a prompt in, one mask per match out. */
|
|
62
|
+
| "mask"
|
|
63
|
+
/** Video in, video out, no prompt: upscale, frame interpolation, SDR to HDR, background removal, subtitles. */
|
|
64
|
+
| "video-tool"
|
|
65
|
+
/** Text to speech (`generateSpeech`). */
|
|
66
|
+
| "speech"
|
|
67
|
+
/** Speech to speech in another voice (`changeVoice`). */
|
|
68
|
+
| "voice-change"
|
|
69
|
+
/** Speech translated into `targetLanguage` (`dub`), from a video or an audio file. */
|
|
70
|
+
| "dubbing"
|
|
71
|
+
/** A face driven by speech (`lipsync`): a `sourceVideo` re-timed or a still `image` animated. */
|
|
72
|
+
| "lipsync"
|
|
73
|
+
/** Speech to text (`transcribe`). */
|
|
74
|
+
| "transcription";
|
|
48
75
|
/** What a `video-tool` row does to its source clip. */
|
|
49
|
-
type VideoToolKind = "upscale" | "interpolate" | "hdr";
|
|
76
|
+
type VideoToolKind = "upscale" | "interpolate" | "hdr" | "bg-remove" | "subtitles";
|
|
50
77
|
/** Container/codec a video-tool row can write. */
|
|
51
|
-
|
|
78
|
+
/** `exr`: a ZIP of 16-bit EXR frames in `VideoToolResult.frames`, with an MP4 preview as `video`. */
|
|
79
|
+
type VideoToolOutputFormat = "h265" | "prores" | "exr";
|
|
52
80
|
type Lifecycle = "active" | "deprecated" | "retired";
|
|
53
81
|
type Surface = "cowork" | "space_builder";
|
|
54
82
|
/** @deprecated use Surface[] */
|
|
@@ -78,6 +106,10 @@ interface ImageRequest {
|
|
|
78
106
|
temperature?: number;
|
|
79
107
|
/** Upscaler controls beyond `scaleFactor`/`outputFormat` (Topaz). */
|
|
80
108
|
upscale?: UpscaleOptions;
|
|
109
|
+
/** Mask rows with `supports: points`: spots that refine what the prompt selects. */
|
|
110
|
+
points?: MaskPoint[];
|
|
111
|
+
/** Mask rows with `supports: boxes`: boxes around the objects to mask. */
|
|
112
|
+
boxes?: MaskBox[];
|
|
81
113
|
}
|
|
82
114
|
/**
|
|
83
115
|
* What a caller passes to generateImage. Same field names as the AI SDK's
|
|
@@ -125,6 +157,12 @@ interface VideoRequest {
|
|
|
125
157
|
* adapter sends the prompt alone; `taskType: "extend"` still selects the extend path. */
|
|
126
158
|
previousInteractionId?: string;
|
|
127
159
|
mode?: "standard" | "pro";
|
|
160
|
+
/** Rows with `supports: ["insertWindow"]`: where the generated scene starts in the
|
|
161
|
+
* source clip and where the source footage resumes, in seconds. */
|
|
162
|
+
insertWindow?: {
|
|
163
|
+
startSeconds: number;
|
|
164
|
+
resumeSeconds: number;
|
|
165
|
+
};
|
|
128
166
|
}
|
|
129
167
|
/**
|
|
130
168
|
* What a caller passes to generateVideo. `duration` is the AI SDK spelling of
|
|
@@ -152,12 +190,38 @@ interface VideoToolRequest {
|
|
|
152
190
|
source: VideoToolSource;
|
|
153
191
|
/** Upscale rows. */
|
|
154
192
|
upscaleFactor?: number;
|
|
155
|
-
/**
|
|
193
|
+
/** Rows whose `constraints.tool.prompt` is set; ignored by every other row. */
|
|
156
194
|
prompt?: string;
|
|
157
195
|
/** Interpolate rows. */
|
|
158
196
|
targetFps?: number;
|
|
159
197
|
/** HDR rows; the row's first `outputFormats` entry when unset. */
|
|
160
198
|
outputFormat?: VideoToolOutputFormat;
|
|
199
|
+
/** Subtitles rows: caption style and language; the row's first preset when unset. */
|
|
200
|
+
subtitles?: SubtitleOptions;
|
|
201
|
+
}
|
|
202
|
+
/** Per-tier caption text overrides; an unset field keeps the preset's own. */
|
|
203
|
+
interface SubtitleTextStyle {
|
|
204
|
+
/** A Google Font name the provider supports. */
|
|
205
|
+
font?: string;
|
|
206
|
+
/** 100 to 900. */
|
|
207
|
+
weight?: number;
|
|
208
|
+
/** `#rgb` or `#rrggbb`. */
|
|
209
|
+
color?: string;
|
|
210
|
+
}
|
|
211
|
+
/** Burned-in caption options; every unset field keeps the preset's own. */
|
|
212
|
+
interface SubtitleOptions {
|
|
213
|
+
/** One of `constraints.tool.presets`. */
|
|
214
|
+
preset?: string;
|
|
215
|
+
/** The spoken language (one of `tool.languages`); the provider detects it when unset. */
|
|
216
|
+
language?: string;
|
|
217
|
+
/** Caption in this language instead (one of `tool.translationLanguages`). */
|
|
218
|
+
translationLanguage?: string;
|
|
219
|
+
position?: "top" | "center" | "bottom";
|
|
220
|
+
shadow?: "none" | "min" | "mid" | "max";
|
|
221
|
+
/** Every word. */
|
|
222
|
+
baseline?: SubtitleTextStyle;
|
|
223
|
+
/** The words the provider marks as key. */
|
|
224
|
+
highlighted?: SubtitleTextStyle;
|
|
161
225
|
}
|
|
162
226
|
/** The output a video-tool request will produce, from the request alone. */
|
|
163
227
|
interface VideoToolOutputSpec {
|
|
@@ -165,8 +229,11 @@ interface VideoToolOutputSpec {
|
|
|
165
229
|
height: number;
|
|
166
230
|
durationSeconds: number;
|
|
167
231
|
fps?: number;
|
|
232
|
+
/** HDR: the frames the row renders at `fps`, which the request sends. */
|
|
233
|
+
frames?: number;
|
|
168
234
|
resolution: VideoResolution;
|
|
169
|
-
|
|
235
|
+
/** `vp9` (WebM with alpha) is what a `bg-remove` row writes. */
|
|
236
|
+
format: "h264" | "vp9" | VideoToolOutputFormat;
|
|
170
237
|
}
|
|
171
238
|
interface VideoToolCallContext extends CallContext {
|
|
172
239
|
/** Where the provider posts the result when the job ends. */
|
|
@@ -194,6 +261,12 @@ interface VideoToolResult {
|
|
|
194
261
|
mime?: string;
|
|
195
262
|
bytes?: number;
|
|
196
263
|
};
|
|
264
|
+
/** The frame archive of an `exr` row; `video` is then its preview. */
|
|
265
|
+
frames?: {
|
|
266
|
+
url: string;
|
|
267
|
+
mime?: string;
|
|
268
|
+
bytes?: number;
|
|
269
|
+
};
|
|
197
270
|
output: VideoToolOutputSpec;
|
|
198
271
|
usage: UsageEvent;
|
|
199
272
|
raw?: unknown;
|
|
@@ -209,22 +282,118 @@ interface AudioRequest {
|
|
|
209
282
|
seed?: number;
|
|
210
283
|
/** Music models: no vocals. */
|
|
211
284
|
instrumental?: boolean;
|
|
285
|
+
/** Music rows with `supports: lyrics`: the words to sing, with [verse]/[chorus] tags. */
|
|
286
|
+
lyrics?: string;
|
|
287
|
+
/** One of the row's `constraints.outputFormats`; the row default when unset. */
|
|
288
|
+
outputFormat?: string;
|
|
212
289
|
/** Cancellation; combined with CallContext.signal before dispatch. */
|
|
213
290
|
abortSignal?: AbortSignal;
|
|
214
291
|
}
|
|
292
|
+
/** A provider file: a URL it hosts, or the bytes when it returns them inline. */
|
|
293
|
+
type MediaOutput = {
|
|
294
|
+
bytes: Uint8Array;
|
|
295
|
+
mime: string;
|
|
296
|
+
} | {
|
|
297
|
+
url: string;
|
|
298
|
+
mime?: string;
|
|
299
|
+
expiresAt?: Date;
|
|
300
|
+
};
|
|
215
301
|
interface AudioResult {
|
|
216
|
-
audio:
|
|
217
|
-
bytes: Uint8Array;
|
|
218
|
-
mime: string;
|
|
219
|
-
} | {
|
|
220
|
-
url: string;
|
|
221
|
-
expiresAt?: Date;
|
|
222
|
-
};
|
|
302
|
+
audio: MediaOutput;
|
|
223
303
|
/** Lyria returns lyrics as text parts next to the audio. */
|
|
224
304
|
text?: string;
|
|
225
305
|
usage: UsageEvent;
|
|
226
306
|
raw?: JsonValue;
|
|
227
307
|
}
|
|
308
|
+
/** `generateSpeech` on a `speech` row. Voice, language and format are ids the row lists. */
|
|
309
|
+
interface SpeechRequest {
|
|
310
|
+
model: string;
|
|
311
|
+
/** The script, spoken verbatim. */
|
|
312
|
+
text: string;
|
|
313
|
+
/** One of `constraints.voices[].id`; the row default when unset. */
|
|
314
|
+
voice?: string;
|
|
315
|
+
/** One of `constraints.languages[].code`; the provider detects it when unset. */
|
|
316
|
+
language?: string;
|
|
317
|
+
/** Rows with `supports: style`: how to speak it ("warm and slow"), kept out of the script. */
|
|
318
|
+
style?: string;
|
|
319
|
+
/** One of `constraints.outputFormats`; the row default when unset. */
|
|
320
|
+
outputFormat?: string;
|
|
321
|
+
abortSignal?: AbortSignal;
|
|
322
|
+
}
|
|
323
|
+
/** `changeVoice` on a `voice-change` row: the recording re-spoken in another voice. */
|
|
324
|
+
interface VoiceChangeRequest {
|
|
325
|
+
model: string;
|
|
326
|
+
/** Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
|
|
327
|
+
sourceAudio: MediaRef;
|
|
328
|
+
voice?: string;
|
|
329
|
+
outputFormat?: string;
|
|
330
|
+
abortSignal?: AbortSignal;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* `lipsync` on a `lipsync` row. The row's `requires` names the face input: `sourceVideo` (a
|
|
334
|
+
* video re-timed to the speech) or `firstFrame` (a still `image` animated).
|
|
335
|
+
*/
|
|
336
|
+
interface LipsyncRequest {
|
|
337
|
+
model: string;
|
|
338
|
+
sourceVideo?: MediaRef;
|
|
339
|
+
image?: MediaRef;
|
|
340
|
+
/** The speech. Set `durationSeconds` so `constraints.references.audioSeconds` can be checked. */
|
|
341
|
+
audio: MediaRef;
|
|
342
|
+
/** Rows that list `constraints.resolutions`; the row default when unset. */
|
|
343
|
+
resolution?: VideoResolution;
|
|
344
|
+
abortSignal?: AbortSignal;
|
|
345
|
+
}
|
|
346
|
+
interface LipsyncResult {
|
|
347
|
+
video: MediaOutput;
|
|
348
|
+
usage: UsageEvent;
|
|
349
|
+
raw?: unknown;
|
|
350
|
+
}
|
|
351
|
+
/** `dub` on a `dubbing` row: exactly one of `sourceVideo` / `sourceAudio`. */
|
|
352
|
+
interface DubbingRequest {
|
|
353
|
+
model: string;
|
|
354
|
+
sourceVideo?: MediaRef;
|
|
355
|
+
sourceAudio?: MediaRef;
|
|
356
|
+
/** One of `constraints.languages[].code`. */
|
|
357
|
+
targetLanguage: string;
|
|
358
|
+
/** One of `constraints.outputFormats` on rows that list them. */
|
|
359
|
+
outputFormat?: string;
|
|
360
|
+
abortSignal?: AbortSignal;
|
|
361
|
+
}
|
|
362
|
+
/** The dubbed media, of the same kind as the source. */
|
|
363
|
+
interface DubbingResult {
|
|
364
|
+
video?: MediaOutput;
|
|
365
|
+
audio?: MediaOutput;
|
|
366
|
+
usage: UsageEvent;
|
|
367
|
+
raw?: unknown;
|
|
368
|
+
}
|
|
369
|
+
interface TranscriptionRequest {
|
|
370
|
+
model: string;
|
|
371
|
+
/** The speech, audio or video. Set `durationSeconds` so limits and usage can use it. */
|
|
372
|
+
source: MediaRef;
|
|
373
|
+
/** One of `constraints.languages[].code`; the provider detects the language when unset. */
|
|
374
|
+
language?: string;
|
|
375
|
+
/** Also return `subtitles` (SRT) built from the word timings. */
|
|
376
|
+
timestamps?: boolean;
|
|
377
|
+
abortSignal?: AbortSignal;
|
|
378
|
+
}
|
|
379
|
+
interface TranscriptWord {
|
|
380
|
+
text: string;
|
|
381
|
+
/** `word`, `spacing` or `audio_event` (ElevenLabs Scribe). */
|
|
382
|
+
type: string;
|
|
383
|
+
start?: number;
|
|
384
|
+
end?: number;
|
|
385
|
+
speakerId?: string;
|
|
386
|
+
}
|
|
387
|
+
interface TranscriptionResult {
|
|
388
|
+
text: string;
|
|
389
|
+
/** SubRip (SRT) cues, when the request asked for `timestamps`. */
|
|
390
|
+
subtitles?: string;
|
|
391
|
+
/** The language the provider detected or was told. */
|
|
392
|
+
language?: string;
|
|
393
|
+
words: TranscriptWord[];
|
|
394
|
+
usage: UsageEvent;
|
|
395
|
+
raw?: JsonValue;
|
|
396
|
+
}
|
|
228
397
|
/** An AI SDK file part ready for generateText/generateObject, e.g. a video for understanding. */
|
|
229
398
|
interface MediaPart {
|
|
230
399
|
type: "file";
|
|
@@ -233,10 +402,18 @@ interface MediaPart {
|
|
|
233
402
|
/** Set when the bytes were uploaded to a provider file store (Gemini Files API). Call `cleanup` after the request. */
|
|
234
403
|
cleanup?: () => Promise<void>;
|
|
235
404
|
}
|
|
236
|
-
type RequiredInput = "firstFrame" | "sourceVideo" | "references";
|
|
405
|
+
type RequiredInput = "firstFrame" | "sourceVideo" | "references" | "sourceAudio";
|
|
237
406
|
type SupportedOption = "seed" | "quality" | "negativePrompt" | "cfgScale" | "generateAudio" | "promptExpansion" | "lastFrame" | "count" | "outputFormat" | "scaleFactor" | "safetySettings" | "temperature" | "upscale" | "watermark" | "safetyChecker" | "taskType" | "instrumental"
|
|
407
|
+
/** Music rows that sing `AudioRequest.lyrics`. */
|
|
408
|
+
| "lyrics"
|
|
409
|
+
/** Speech rows that take `SpeechRequest.style`, a delivery instruction. */
|
|
410
|
+
| "style"
|
|
238
411
|
/** Video rows that extend a clip in fixed segments up to a cumulative cap (see `ModelConstraints.extension`). */
|
|
239
|
-
| "videoExtension"
|
|
412
|
+
| "videoExtension"
|
|
413
|
+
/** Video rows that generate a scene inside a source clip (`VideoRequest.insertWindow`). */
|
|
414
|
+
| "insertWindow"
|
|
415
|
+
/** Mask rows: `ImageRequest.points` and `ImageRequest.boxes`. */
|
|
416
|
+
| "points" | "boxes";
|
|
240
417
|
interface VideoSecondsLimits {
|
|
241
418
|
/** Minimum length of each reference video, in seconds. */
|
|
242
419
|
min?: number;
|
|
@@ -268,6 +445,16 @@ interface ReferenceLimits {
|
|
|
268
445
|
audioFormats?: string[];
|
|
269
446
|
/** Largest reference audio file the provider takes, in bytes. */
|
|
270
447
|
audioMaxBytes?: number;
|
|
448
|
+
/**
|
|
449
|
+
* Video rows: the fewest references of each kind a request needs (Kling 3.0 Motion Control:
|
|
450
|
+
* one image and one video). `requires: ["references"]` needs one of any kind; this names
|
|
451
|
+
* the kinds. Kits before 0.5.0 ignore it.
|
|
452
|
+
*/
|
|
453
|
+
min?: {
|
|
454
|
+
images?: number;
|
|
455
|
+
videos?: number;
|
|
456
|
+
audios?: number;
|
|
457
|
+
};
|
|
271
458
|
}
|
|
272
459
|
interface VideoToolConstraints {
|
|
273
460
|
kind: VideoToolKind;
|
|
@@ -278,7 +465,7 @@ interface VideoToolConstraints {
|
|
|
278
465
|
};
|
|
279
466
|
/** Upscale: the output's long edge may not pass this, in pixels. */
|
|
280
467
|
maxOutputLongEdge?: number;
|
|
281
|
-
/** Upscale: the row takes an optional prompt that guides
|
|
468
|
+
/** Upscale and HDR: the row takes an optional prompt that guides the result. */
|
|
282
469
|
prompt?: boolean;
|
|
283
470
|
/** Interpolate: allowed target frame rate range. */
|
|
284
471
|
fps?: {
|
|
@@ -287,11 +474,45 @@ interface VideoToolConstraints {
|
|
|
287
474
|
};
|
|
288
475
|
/** HDR: the formats the row writes, first is the default. */
|
|
289
476
|
outputFormats?: VideoToolOutputFormat[];
|
|
477
|
+
/** The output's short edge is scaled down to this many pixels, keeping the aspect ratio. */
|
|
478
|
+
maxOutputShortEdge?: number;
|
|
479
|
+
/** The most frames the row renders (duration times frame rate). */
|
|
480
|
+
maxOutputFrames?: number;
|
|
481
|
+
/** HDR: the fewest frames the row renders; a shorter source is padded to it. */
|
|
482
|
+
minOutputFrames?: number;
|
|
483
|
+
/** HDR: the fastest output rate; a faster source renders at this rate. */
|
|
484
|
+
maxOutputFps?: number;
|
|
485
|
+
/** Subtitles: the caption styles, first is the default. */
|
|
486
|
+
presets?: string[];
|
|
487
|
+
/** Subtitles: spoken-language codes the provider transcribes. */
|
|
488
|
+
languages?: string[];
|
|
489
|
+
/** Subtitles: codes the provider can translate the captions into. */
|
|
490
|
+
translationLanguages?: string[];
|
|
491
|
+
/** Subtitles: the longest source above 1080p, in seconds (`sourceVideoSeconds.max` covers the rest). */
|
|
492
|
+
maxSecondsAbove1080p?: number;
|
|
290
493
|
}
|
|
291
494
|
/** Whether a video row's output has sound: always, switchable (`supports: generateAudio`), or silent. */
|
|
292
495
|
type AudioOutput = "always" | "optional" | "never";
|
|
293
496
|
/** How a prompt points at reference N: "image N" numbering, a caption beside each image, or prose. */
|
|
294
497
|
type ReferenceSyntax = "numbered" | "caption" | "descriptive";
|
|
498
|
+
type VoiceGender = "male" | "female" | "neutral";
|
|
499
|
+
/** A voice a row offers. `id` is the value sent to the provider. */
|
|
500
|
+
interface VoiceOption {
|
|
501
|
+
id: string;
|
|
502
|
+
name: string;
|
|
503
|
+
gender?: VoiceGender;
|
|
504
|
+
accent?: string;
|
|
505
|
+
/** Language codes the provider lists for the voice. */
|
|
506
|
+
languages?: string[];
|
|
507
|
+
description?: string;
|
|
508
|
+
/** An https sample of the voice. */
|
|
509
|
+
previewUrl?: string;
|
|
510
|
+
}
|
|
511
|
+
/** A language a row takes. `code` is the value sent to the provider. */
|
|
512
|
+
interface LanguageOption {
|
|
513
|
+
code: string;
|
|
514
|
+
name: string;
|
|
515
|
+
}
|
|
295
516
|
interface PromptConventions {
|
|
296
517
|
referenceSyntax: ReferenceSyntax;
|
|
297
518
|
/** Provider-documented prompt length limit, in characters. */
|
|
@@ -309,6 +530,8 @@ interface ModelConstraints {
|
|
|
309
530
|
durationPresets?: number[];
|
|
310
531
|
/** Curated quality choices for rows whose `supports` includes "quality". */
|
|
311
532
|
qualityOptions?: string[];
|
|
533
|
+
/** Upscale rows: the `scaleFactor` values the row offers; absent means any. */
|
|
534
|
+
scaleFactors?: number[];
|
|
312
535
|
/**
|
|
313
536
|
* Exact pixel size per aspect ratio for rows an app must size verbatim
|
|
314
537
|
* (gpt-image-2 keeps its historic WxH contract); callers pass it as `exactSize`.
|
|
@@ -316,9 +539,26 @@ interface ModelConstraints {
|
|
|
316
539
|
exactSizes?: Record<string, string>;
|
|
317
540
|
references?: ReferenceLimits;
|
|
318
541
|
requires?: RequiredInput[];
|
|
542
|
+
/**
|
|
543
|
+
* Video rows: at least one of these inputs must be present (`requires` needs all of its
|
|
544
|
+
* own). Kits before 0.5.0 ignore it.
|
|
545
|
+
*/
|
|
546
|
+
requiresOneOf?: RequiredInput[];
|
|
547
|
+
/**
|
|
548
|
+
* Video rows whose endpoint has no prompt field (MiniMax H3 Max Relight): the request needs
|
|
549
|
+
* no prompt, and a non-empty one is dropped with an `option_ignored` warning. Absent means
|
|
550
|
+
* the row takes a prompt. Kits before 0.5.0 ignore it.
|
|
551
|
+
*/
|
|
552
|
+
noPrompt?: boolean;
|
|
319
553
|
supports?: SupportedOption[];
|
|
320
554
|
/** Ratio is dropped, with a warning, when one of these inputs is present. */
|
|
321
555
|
ratioIgnoredWith?: ("firstFrame" | "sourceVideo")[];
|
|
556
|
+
/** Speech and voice-change rows: the voices offered; `defaults.voice` is one of their ids. */
|
|
557
|
+
voices?: VoiceOption[];
|
|
558
|
+
/** Speech, transcription and dubbing (target) rows: the languages taken. */
|
|
559
|
+
languages?: LanguageOption[];
|
|
560
|
+
/** Audio-output rows whose provider lets the caller pick a file format; `defaults.outputFormat` is one. */
|
|
561
|
+
outputFormats?: string[];
|
|
322
562
|
/** Length limits for the source video the row edits or extends. */
|
|
323
563
|
sourceVideoSeconds?: Omit<VideoSecondsLimits, "total"> & {
|
|
324
564
|
/** The provider sends the source as a reference video, so it counts toward `references.videoSeconds.total` (Seedance). */
|
|
@@ -411,6 +651,15 @@ interface CatalogCapabilities {
|
|
|
411
651
|
vision?: boolean;
|
|
412
652
|
contextWindow?: number;
|
|
413
653
|
}
|
|
654
|
+
/** Row defaults the request types do not share. */
|
|
655
|
+
interface MediaNodeDefaults {
|
|
656
|
+
/** Image rows: png, jpeg or webp. Audio-output rows: one of `constraints.outputFormats`. */
|
|
657
|
+
outputFormat?: string;
|
|
658
|
+
/** One of `constraints.voices[].id`. */
|
|
659
|
+
voice?: string;
|
|
660
|
+
/** One of `constraints.languages[].code`. */
|
|
661
|
+
language?: string;
|
|
662
|
+
}
|
|
414
663
|
interface CatalogModel {
|
|
415
664
|
/** Canonical id. Equals the pricing key in pro-backend credit_pricing_* tables. */
|
|
416
665
|
id: string;
|
|
@@ -430,7 +679,7 @@ interface CatalogModel {
|
|
|
430
679
|
*/
|
|
431
680
|
exposure: Surface[];
|
|
432
681
|
constraints: ModelConstraints;
|
|
433
|
-
defaults: Partial<Omit<ImageRequest, "model" | "prompt"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt"
|
|
682
|
+
defaults: Partial<Omit<ImageRequest, "model" | "prompt" | "outputFormat"> & Omit<VideoRequest, "model" | "prompt"> & Omit<AudioRequest, "model" | "prompt" | "outputFormat">> & MediaNodeDefaults;
|
|
434
683
|
/** Provider options merged under the caller's on every call. Chat-only tuning belongs in display.chat. */
|
|
435
684
|
providerOptions?: ProviderOptions;
|
|
436
685
|
/**
|
|
@@ -676,7 +925,11 @@ declare function isListedOn(row: CatalogModel, surface: Surface): boolean;
|
|
|
676
925
|
/** True when an active row is listed on at least one surface. */
|
|
677
926
|
declare function isListed(row: CatalogModel): boolean;
|
|
678
927
|
|
|
679
|
-
/**
|
|
928
|
+
/**
|
|
929
|
+
* Every row, aggregated from the exported per-type collections only, so a row added anywhere
|
|
930
|
+
* else never reaches MODELS without its collection. Seeded from Cowork, Space Builder and
|
|
931
|
+
* trigger-workflows. See catalog/*.ts.
|
|
932
|
+
*/
|
|
680
933
|
declare const MODELS: CatalogModel[];
|
|
681
934
|
|
|
682
935
|
declare const ADAPTER_IDS: readonly ["ai-sdk-text", "google-image", "openai-image", "google-genai", "ark", "fal", "replicate", "prodia", "higgsfield", "xai-video"];
|
|
@@ -704,9 +957,16 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
704
957
|
image: "image";
|
|
705
958
|
video: "video";
|
|
706
959
|
audio: "audio";
|
|
960
|
+
"sound-effect": "sound-effect";
|
|
707
961
|
upscale: "upscale";
|
|
708
962
|
"bg-remove": "bg-remove";
|
|
963
|
+
mask: "mask";
|
|
709
964
|
"video-tool": "video-tool";
|
|
965
|
+
speech: "speech";
|
|
966
|
+
"voice-change": "voice-change";
|
|
967
|
+
dubbing: "dubbing";
|
|
968
|
+
lipsync: "lipsync";
|
|
969
|
+
transcription: "transcription";
|
|
710
970
|
}>;
|
|
711
971
|
adapter: z.ZodEnum<{
|
|
712
972
|
"ai-sdk-text": "ai-sdk-text";
|
|
@@ -769,6 +1029,7 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
769
1029
|
}, z.core.$loose>, z.ZodArray<z.ZodNumber>]>>;
|
|
770
1030
|
durationPresets: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
771
1031
|
qualityOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1032
|
+
scaleFactors: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
772
1033
|
exactSizes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
773
1034
|
references: z.ZodOptional<z.ZodObject<{
|
|
774
1035
|
images: z.ZodOptional<z.ZodNumber>;
|
|
@@ -790,12 +1051,25 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
790
1051
|
}, z.core.$loose>>;
|
|
791
1052
|
audioFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
792
1053
|
audioMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
1054
|
+
min: z.ZodOptional<z.ZodObject<{
|
|
1055
|
+
images: z.ZodOptional<z.ZodNumber>;
|
|
1056
|
+
videos: z.ZodOptional<z.ZodNumber>;
|
|
1057
|
+
audios: z.ZodOptional<z.ZodNumber>;
|
|
1058
|
+
}, z.core.$loose>>;
|
|
793
1059
|
}, z.core.$loose>>;
|
|
794
1060
|
requires: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
795
1061
|
references: "references";
|
|
796
1062
|
firstFrame: "firstFrame";
|
|
797
1063
|
sourceVideo: "sourceVideo";
|
|
1064
|
+
sourceAudio: "sourceAudio";
|
|
1065
|
+
}>>>;
|
|
1066
|
+
requiresOneOf: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1067
|
+
references: "references";
|
|
1068
|
+
firstFrame: "firstFrame";
|
|
1069
|
+
sourceVideo: "sourceVideo";
|
|
1070
|
+
sourceAudio: "sourceAudio";
|
|
798
1071
|
}>>>;
|
|
1072
|
+
noPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
799
1073
|
supports: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
800
1074
|
upscale: "upscale";
|
|
801
1075
|
quality: "quality";
|
|
@@ -805,6 +1079,8 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
805
1079
|
scaleFactor: "scaleFactor";
|
|
806
1080
|
safetySettings: "safetySettings";
|
|
807
1081
|
temperature: "temperature";
|
|
1082
|
+
points: "points";
|
|
1083
|
+
boxes: "boxes";
|
|
808
1084
|
lastFrame: "lastFrame";
|
|
809
1085
|
generateAudio: "generateAudio";
|
|
810
1086
|
negativePrompt: "negativePrompt";
|
|
@@ -813,13 +1089,34 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
813
1089
|
watermark: "watermark";
|
|
814
1090
|
safetyChecker: "safetyChecker";
|
|
815
1091
|
taskType: "taskType";
|
|
1092
|
+
insertWindow: "insertWindow";
|
|
816
1093
|
instrumental: "instrumental";
|
|
1094
|
+
lyrics: "lyrics";
|
|
1095
|
+
style: "style";
|
|
817
1096
|
videoExtension: "videoExtension";
|
|
818
1097
|
}>>>;
|
|
819
1098
|
ratioIgnoredWith: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
820
1099
|
firstFrame: "firstFrame";
|
|
821
1100
|
sourceVideo: "sourceVideo";
|
|
822
1101
|
}>>>;
|
|
1102
|
+
voices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1103
|
+
id: z.ZodString;
|
|
1104
|
+
name: z.ZodString;
|
|
1105
|
+
gender: z.ZodOptional<z.ZodEnum<{
|
|
1106
|
+
male: "male";
|
|
1107
|
+
female: "female";
|
|
1108
|
+
neutral: "neutral";
|
|
1109
|
+
}>>;
|
|
1110
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1112
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1113
|
+
previewUrl: z.ZodOptional<z.ZodURL>;
|
|
1114
|
+
}, z.core.$loose>>>;
|
|
1115
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1116
|
+
code: z.ZodString;
|
|
1117
|
+
name: z.ZodString;
|
|
1118
|
+
}, z.core.$loose>>>;
|
|
1119
|
+
outputFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
823
1120
|
sourceVideoSeconds: z.ZodOptional<z.ZodObject<{
|
|
824
1121
|
max: z.ZodOptional<z.ZodNumber>;
|
|
825
1122
|
min: z.ZodOptional<z.ZodNumber>;
|
|
@@ -837,8 +1134,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
837
1134
|
tool: z.ZodOptional<z.ZodObject<{
|
|
838
1135
|
kind: z.ZodEnum<{
|
|
839
1136
|
upscale: "upscale";
|
|
1137
|
+
"bg-remove": "bg-remove";
|
|
840
1138
|
interpolate: "interpolate";
|
|
841
1139
|
hdr: "hdr";
|
|
1140
|
+
subtitles: "subtitles";
|
|
842
1141
|
}>;
|
|
843
1142
|
upscaleFactor: z.ZodOptional<z.ZodObject<{
|
|
844
1143
|
min: z.ZodNumber;
|
|
@@ -853,7 +1152,16 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
853
1152
|
outputFormats: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
854
1153
|
h265: "h265";
|
|
855
1154
|
prores: "prores";
|
|
1155
|
+
exr: "exr";
|
|
856
1156
|
}>>>;
|
|
1157
|
+
maxOutputShortEdge: z.ZodOptional<z.ZodNumber>;
|
|
1158
|
+
maxOutputFrames: z.ZodOptional<z.ZodNumber>;
|
|
1159
|
+
minOutputFrames: z.ZodOptional<z.ZodNumber>;
|
|
1160
|
+
maxOutputFps: z.ZodOptional<z.ZodNumber>;
|
|
1161
|
+
presets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1162
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1163
|
+
translationLanguages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1164
|
+
maxSecondsAbove1080p: z.ZodOptional<z.ZodNumber>;
|
|
857
1165
|
}, z.core.$loose>>;
|
|
858
1166
|
audio: z.ZodOptional<z.ZodUnknown>;
|
|
859
1167
|
prompt: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -905,11 +1213,11 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
905
1213
|
}>>;
|
|
906
1214
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
907
1215
|
count: z.ZodOptional<z.ZodNumber>;
|
|
908
|
-
outputFormat: z.ZodOptional<z.ZodEnum<{
|
|
1216
|
+
outputFormat: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
909
1217
|
png: "png";
|
|
910
1218
|
jpeg: "jpeg";
|
|
911
1219
|
webp: "webp";
|
|
912
|
-
}>>;
|
|
1220
|
+
}>, z.ZodString]>>;
|
|
913
1221
|
scaleFactor: z.ZodOptional<z.ZodNumber>;
|
|
914
1222
|
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
915
1223
|
category: z.ZodString;
|
|
@@ -923,6 +1231,20 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
923
1231
|
faceEnhancementCreativity: z.ZodOptional<z.ZodNumber>;
|
|
924
1232
|
faceEnhancementStrength: z.ZodOptional<z.ZodNumber>;
|
|
925
1233
|
}, z.core.$loose>>;
|
|
1234
|
+
points: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1235
|
+
x: z.ZodNumber;
|
|
1236
|
+
y: z.ZodNumber;
|
|
1237
|
+
label: z.ZodOptional<z.ZodEnum<{
|
|
1238
|
+
foreground: "foreground";
|
|
1239
|
+
background: "background";
|
|
1240
|
+
}>>;
|
|
1241
|
+
}, z.core.$loose>>>;
|
|
1242
|
+
boxes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1243
|
+
xMin: z.ZodNumber;
|
|
1244
|
+
yMin: z.ZodNumber;
|
|
1245
|
+
xMax: z.ZodNumber;
|
|
1246
|
+
yMax: z.ZodNumber;
|
|
1247
|
+
}, z.core.$loose>>>;
|
|
926
1248
|
firstFrame: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
927
1249
|
url: z.ZodString;
|
|
928
1250
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -1003,6 +1325,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1003
1325
|
}>>;
|
|
1004
1326
|
watermark: z.ZodOptional<z.ZodBoolean>;
|
|
1005
1327
|
safetyChecker: z.ZodOptional<z.ZodBoolean>;
|
|
1328
|
+
insertWindow: z.ZodOptional<z.ZodObject<{
|
|
1329
|
+
startSeconds: z.ZodNumber;
|
|
1330
|
+
resumeSeconds: z.ZodNumber;
|
|
1331
|
+
}, z.core.$loose>>;
|
|
1006
1332
|
taskType: z.ZodOptional<z.ZodEnum<{
|
|
1007
1333
|
reference: "reference";
|
|
1008
1334
|
edit: "edit";
|
|
@@ -1013,6 +1339,9 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
|
|
|
1013
1339
|
pro: "pro";
|
|
1014
1340
|
}>>;
|
|
1015
1341
|
instrumental: z.ZodOptional<z.ZodBoolean>;
|
|
1342
|
+
lyrics: z.ZodOptional<z.ZodString>;
|
|
1343
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
1344
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1016
1345
|
}, z.core.$loose>;
|
|
1017
1346
|
providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<ProviderOptionValue, unknown, z.core.$ZodTypeInternals<ProviderOptionValue, unknown>>>>>;
|
|
1018
1347
|
usage: z.ZodObject<{
|
|
@@ -1144,6 +1473,14 @@ interface AdapterContext {
|
|
|
1144
1473
|
call: CallContext;
|
|
1145
1474
|
warnings: Warning[];
|
|
1146
1475
|
}
|
|
1476
|
+
/** A dubbed video is a provider job the client waits on; dubbed audio arrives in one call. */
|
|
1477
|
+
type DubbingOutcome = {
|
|
1478
|
+
kind: "video";
|
|
1479
|
+
job: VideoJob;
|
|
1480
|
+
} | {
|
|
1481
|
+
kind: "audio";
|
|
1482
|
+
result: AudioResult;
|
|
1483
|
+
};
|
|
1147
1484
|
/**
|
|
1148
1485
|
* One adapter per provider API. The request the adapter receives has already
|
|
1149
1486
|
* passed resolveOptions: every option is inside the catalog constraints and the
|
|
@@ -1156,6 +1493,11 @@ interface Adapter {
|
|
|
1156
1493
|
/** Reconnect to a job `generateVideo` submitted earlier; never submits. */
|
|
1157
1494
|
resumeVideo?(req: VideoRequest, jobId: string, ctx: AdapterContext): VideoJob;
|
|
1158
1495
|
generateAudio?(req: AudioRequest, ctx: AdapterContext): Promise<AudioResult>;
|
|
1496
|
+
generateSpeech?(req: SpeechRequest, ctx: AdapterContext): Promise<AudioResult>;
|
|
1497
|
+
changeVoice?(req: VoiceChangeRequest, ctx: AdapterContext): Promise<AudioResult>;
|
|
1498
|
+
lipsync?(req: LipsyncRequest, ctx: AdapterContext): Promise<VideoJob>;
|
|
1499
|
+
dub?(req: DubbingRequest, ctx: AdapterContext): Promise<DubbingOutcome>;
|
|
1500
|
+
transcribe?(req: TranscriptionRequest, ctx: AdapterContext): Promise<TranscriptionResult>;
|
|
1159
1501
|
/** Video tools run as provider jobs the caller tracks; see ModelKit.submitVideoTool. */
|
|
1160
1502
|
submitVideoTool?(req: VideoToolRequest, ctx: AdapterContext, opts: {
|
|
1161
1503
|
webhookUrl?: string;
|
|
@@ -1254,6 +1596,17 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
1254
1596
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1255
1597
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
1256
1598
|
|
|
1599
|
+
/** `generateSpeech` on a `speech` row. */
|
|
1600
|
+
declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
|
|
1601
|
+
/** `changeVoice` on a `voice-change` row. */
|
|
1602
|
+
declare function resolveVoiceChangeOptions(model: CatalogModel, request: VoiceChangeRequest, onUnsupported?: OnUnsupported): ResolveResult<VoiceChangeRequest>;
|
|
1603
|
+
/** `lipsync` on a `lipsync` row: the face input is the one its `requires` names. */
|
|
1604
|
+
declare function resolveLipsyncOptions(model: CatalogModel, request: LipsyncRequest, onUnsupported?: OnUnsupported): ResolveResult<LipsyncRequest>;
|
|
1605
|
+
/** `dub` on a `dubbing` row: one source, a target language the row lists. */
|
|
1606
|
+
declare function resolveDubbingOptions(model: CatalogModel, request: DubbingRequest, onUnsupported?: OnUnsupported): ResolveResult<DubbingRequest>;
|
|
1607
|
+
/** `transcribe` on a `transcription` row. */
|
|
1608
|
+
declare function resolveTranscriptionOptions(model: CatalogModel, request: TranscriptionRequest, onUnsupported?: OnUnsupported): ResolveResult<TranscriptionRequest>;
|
|
1609
|
+
|
|
1257
1610
|
/** Which key names an adapter needs. All of them must be set on a tier for that tier to win. */
|
|
1258
1611
|
declare const ADAPTER_KEYS: Record<AdapterId, ProviderKeyName[]>;
|
|
1259
1612
|
/** The required names the given non-pro tier is missing. */
|
|
@@ -1293,6 +1646,27 @@ declare function pollUntil<T>(check: () => Promise<T | undefined>, opts: {
|
|
|
1293
1646
|
maxIntervalMs?: number;
|
|
1294
1647
|
}): Promise<T>;
|
|
1295
1648
|
|
|
1649
|
+
/** `lipsync` and a video `dub` wait on a provider job; `wait` tunes that wait. */
|
|
1650
|
+
interface MediaJobCallContext extends CallContext {
|
|
1651
|
+
wait?: {
|
|
1652
|
+
pollIntervalMs?: number;
|
|
1653
|
+
timeoutMs?: number;
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
/** The single-purpose audio and lipsync node methods of the kit. */
|
|
1657
|
+
interface AudioNodeMethods {
|
|
1658
|
+
/** Text to speech on a `speech` row. Blocks until the provider returns the audio. */
|
|
1659
|
+
generateSpeech(req: SpeechRequest, call?: CallContext): Promise<AudioResult>;
|
|
1660
|
+
/** Re-speaks a recording in another voice on a `voice-change` row. */
|
|
1661
|
+
changeVoice(req: VoiceChangeRequest, call?: CallContext): Promise<AudioResult>;
|
|
1662
|
+
/** Drives a face (`sourceVideo` or `image`) with speech on a `lipsync` row. */
|
|
1663
|
+
lipsync(req: LipsyncRequest, call?: MediaJobCallContext): Promise<LipsyncResult>;
|
|
1664
|
+
/** Speech to text on a `transcription` row; `timestamps` adds SRT `subtitles`. */
|
|
1665
|
+
transcribe(req: TranscriptionRequest, call?: CallContext): Promise<TranscriptionResult>;
|
|
1666
|
+
/** Dubs a video or an audio file into `targetLanguage`; the result is the same kind. */
|
|
1667
|
+
dub(req: DubbingRequest, call?: MediaJobCallContext): Promise<DubbingResult>;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1296
1670
|
/**
|
|
1297
1671
|
* The AI SDK `LanguageModel` type. A string is a catalog id or alias; a provider
|
|
1298
1672
|
* instance (`openai("gpt-4o")`) runs through the SDK unchanged, with usage
|
|
@@ -1349,7 +1723,7 @@ type StreamTextCallOptions<TOOLS extends ToolSet, OUTPUT extends Output.Output =
|
|
|
1349
1723
|
/** @deprecated Use `prepareStep`; accepted for parity with `generateText`. */
|
|
1350
1724
|
experimental_prepareStep?: Parameters<typeof streamText$1<TOOLS, OUTPUT>>[0]["prepareStep"];
|
|
1351
1725
|
};
|
|
1352
|
-
interface ModelKit extends TextMethods {
|
|
1726
|
+
interface ModelKit extends TextMethods, AudioNodeMethods {
|
|
1353
1727
|
catalog: Catalog;
|
|
1354
1728
|
/**
|
|
1355
1729
|
* Generate one or more images. Blocks until the provider returns bytes.
|
|
@@ -1371,7 +1745,11 @@ interface ModelKit extends TextMethods {
|
|
|
1371
1745
|
languageModel(modelId: string, call?: CallContext): LanguageModelHandle;
|
|
1372
1746
|
/** Usage-event `provider` for a catalog model, without building it: "bedrock" on Bedrock, else the vendor. */
|
|
1373
1747
|
usageProvider(modelId: string, call?: CallContext): string;
|
|
1374
|
-
/**
|
|
1748
|
+
/**
|
|
1749
|
+
* Generate music (`audio`) or a sound effect (`sound-effect`). Blocks until the provider
|
|
1750
|
+
* returns audio. Speech, voice change, lipsync, dubbing and transcription have their own
|
|
1751
|
+
* methods (AudioNodeMethods).
|
|
1752
|
+
*/
|
|
1375
1753
|
generateAudio(req: AudioRequest, call?: CallContext): Promise<AudioResult>;
|
|
1376
1754
|
/**
|
|
1377
1755
|
* Stream text. Mirrors `TextMethods.streamText` and also accepts the
|
|
@@ -1508,4 +1886,4 @@ declare function describeThrown(cause: unknown): ThrownErrorInfo;
|
|
|
1508
1886
|
/** Add the AI SDK `GeneratedFile` accessors to adapter image bytes. base64 is computed on first read. */
|
|
1509
1887
|
declare function toGeneratedImage(image: ImageBytes): GeneratedImage;
|
|
1510
1888
|
|
|
1511
|
-
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, missingTierKeys, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveImageOptions, resolveKeys, resolveVideoOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|
|
1889
|
+
export { ADAPTER_IDS, ADAPTER_KEYS, ARRAY_INPUT_SPEC_KEYS, AUDIO_INPUT_SPEC_KEYS, type Adapter, type AdapterContext, type AdapterEndpoints, type AdapterId, type AdapterRegistry, type AiTextProviderOptions, type ArrayInputSpecKey, type AspectRatio, type AudioNodeMethods, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type CatalogTextModel, DEFAULT_ADAPTERS, type DataOnlyRow, type DataOnlyVerdict, type DefaultObjectOutput, type DubbingOutcome, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type FalWebhookBody, type GeneratedImage, IMAGE_INPUT_SPEC_KEYS, INPUT_SPEC_SUPPORTS_KEYS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type InputSpec, type InputSpecDimensions, type InputSpecIssue, type InputSpecKey, InputSpecSchema, type JsonObject, JsonObjectSchema, type JsonPrimitive, type JsonValue, JsonValueSchema, type KeyTier, type LanguageModelHandle, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MODELS, type MaskBox, type MaskPoint, type MediaJobCallContext, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type ModelConstraints, type ModelKit, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, type ModelkitGenerateObjectOptions, type ModelkitGenerateTextOptions, type ModelkitStreamObjectOptions, type ModelkitStreamTextOptions, type ObjectOutput, type ObjectResult, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveResult, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, type TextMethods, type TextModelInstance, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_INPUT_SPEC_KEYS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, adapterServesType, aiSdkTextAdapter, arkAdapter, aspectRatioToSize, classifyHttpError, compareCatalogOrder, createDefaultModelKit, createModelKit, dataOnlyCapable, describe, describeThrown, generateImage as experimental_generateImage, falAdapter, falWebhookBodySchema, fileCatalogCache, generateAudio, generateImage, generateObject, generateText, generateVideo, googleGenaiAdapter, googleImageAdapter, hasAwsCredentials, higgsfieldAdapter, isArrayInputSpecKey, isInputSpecKey, isListed, isListedOn, isModelKitError, keysFromEnv, languageModel, liveCatalog, liveState, mergeTextProviderOptions, missingTierKeys, nearestAspectRatio, normalizeExposure, openaiImageAdapter, passthroughTextModel, planVideoTool, pollUntil, prepareMediaPart, primeCatalog, prodiaAdapter, readErrorBody, replicateAdapter, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveKeys, resolveLipsyncOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, shouldRetry, sleep, sortCatalogRows, streamObject, streamText, textUsageEvent, toGeneratedImage, validateInputSpec, videoLengthViolation, videoToolConstraints, withRetry, xaiVideoAdapter };
|