@henjicc/ai-sdk 0.8.0 → 0.10.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 +275 -211
- package/README.md +580 -577
- package/dist/capabilities/speech-recognition/bailian/module.js +40 -26
- package/dist/capabilities/speech-recognition/bailian/parse.js +9 -2
- package/dist/capabilities/speech-recognition/bailian/presets.d.ts +9 -1
- package/dist/capabilities/speech-recognition/bailian/presets.js +7 -2
- package/dist/capabilities/speech-recognition/bailian/realtime/presets.d.ts +2 -1
- package/dist/capabilities/speech-recognition/bailian/realtime/presets.js +2 -0
- package/dist/capabilities/speech-recognition/bailian/types.d.ts +2 -0
- package/dist/capabilities/speech-recognition/bailian/upload.js +11 -58
- package/dist/capabilities/speech-recognition/index.d.ts +5 -0
- package/dist/capabilities/speech-recognition/siliconflow/presets.d.ts +2 -3
- package/dist/capabilities/speech-recognition/siliconflow/presets.js +0 -2
- package/dist/capabilities/translation/bailian/types.d.ts +3 -0
- package/dist/capabilities/translation/bailian/types.js +6 -4
- package/dist/catalog/apimart/flux-3-image.model.d.ts +3 -0
- package/dist/catalog/apimart/flux-3-image.model.js +62 -0
- package/dist/catalog/apimart/flux-3-video.model.d.ts +3 -0
- package/dist/catalog/apimart/flux-3-video.model.js +120 -0
- package/dist/catalog/apimart/gemini-omni-1.2-flash.model.d.ts +3 -0
- package/dist/catalog/apimart/gemini-omni-1.2-flash.model.js +175 -0
- package/dist/catalog/apimart/gemini-omni-flash.model.js +30 -37
- package/dist/catalog/apimart/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/apimart/gpt-image-2.6.model.d.ts +3 -0
- package/dist/catalog/apimart/gpt-image-2.6.model.js +103 -0
- package/dist/catalog/apimart/gpt-image-2.model.js +1 -1
- package/dist/catalog/apimart/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/apimart/grok-imagine-video-1.5.model.d.ts +3 -0
- package/dist/catalog/apimart/grok-imagine-video-1.5.model.js +85 -0
- package/dist/catalog/apimart/happyhorse-1.1.model.d.ts +3 -0
- package/dist/catalog/apimart/happyhorse-1.1.model.js +78 -0
- package/dist/catalog/apimart/kling-3.0-omni.model.js +12 -2
- package/dist/catalog/apimart/kling-3.0-turbo.model.js +5 -2
- package/dist/catalog/apimart/kling-3.0.model.js +1 -1
- package/dist/catalog/apimart/kling-4.0.model.d.ts +3 -0
- package/dist/catalog/apimart/kling-4.0.model.js +149 -0
- package/dist/catalog/apimart/midjourney-video.model.js +31 -32
- package/dist/catalog/apimart/midjourney.model.js +11 -1
- package/dist/catalog/apimart/minimax-h3-max.model.d.ts +3 -0
- package/dist/catalog/apimart/minimax-h3-max.model.js +101 -0
- package/dist/catalog/apimart/minimax-h3.model.js +8 -3
- package/dist/catalog/apimart/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/apimart/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/apimart/nano-banana-2.1.model.js +49 -0
- package/dist/catalog/apimart/nano-banana-2.model.js +1 -1
- package/dist/catalog/apimart/nano-banana-pro.model.js +1 -1
- package/dist/catalog/apimart/qwen-image-3.0.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.0-fast.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.0-mini.model.js +4 -4
- package/dist/catalog/apimart/seedance-2.0.model.js +1 -1
- package/dist/catalog/apimart/seedance-2.5.model.js +27 -5
- package/dist/catalog/apimart/seedream-5.0-flash.model.d.ts +3 -0
- package/dist/catalog/apimart/seedream-5.0-flash.model.js +52 -0
- package/dist/catalog/apimart/seedream-5.0-lite.model.js +4 -4
- package/dist/catalog/apimart/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/apimart/veo-3.1.model.d.ts +3 -0
- package/dist/catalog/apimart/veo-3.1.model.js +132 -0
- package/dist/catalog/apimart/wan-2.7-image.model.d.ts +3 -0
- package/dist/catalog/apimart/wan-2.7-image.model.js +80 -0
- package/dist/catalog/apimart/wan-3.0.model.d.ts +3 -0
- package/dist/catalog/apimart/wan-3.0.model.js +101 -0
- package/dist/catalog/apimart/z-image-turbo.model.js +1 -1
- package/dist/catalog/audio/tts-common.d.ts +2 -1
- package/dist/catalog/audio/tts-common.js +5 -1
- package/dist/catalog/bailian/cosyvoice-v3.5.model.js +1 -1
- package/dist/catalog/bailian/minimax-h3.model.d.ts +3 -0
- package/dist/catalog/bailian/minimax-h3.model.js +95 -0
- package/dist/catalog/bailian/minimax-speech-2.8.model.js +1 -1
- package/dist/catalog/bailian/qwen-audio-3.1-tts-flash.model.js +14 -3
- package/dist/catalog/bailian/qwen-audio-3.1-tts-plus.model.d.ts +2 -0
- package/dist/catalog/bailian/qwen-audio-3.1-tts-plus.model.js +44 -0
- package/dist/catalog/bailian/qwen-image-3.0.model.js +1 -1
- package/dist/catalog/bailian/wan-3.0.model.d.ts +3 -0
- package/dist/catalog/bailian/wan-3.0.model.js +104 -0
- package/dist/catalog/bailian/z-image-turbo.model.js +1 -1
- package/dist/catalog/consumer-contract.d.ts +16 -1
- package/dist/catalog/consumer-contract.js +31 -0
- package/dist/catalog/continuation.d.ts +20 -0
- package/dist/catalog/continuation.js +41 -0
- package/dist/catalog/fal/bria-creative-upscale.model.js +1 -1
- package/dist/catalog/fal/eleven-v3-tts.model.js +1 -1
- package/dist/catalog/fal/eleven-v4-tts.model.d.ts +2 -0
- package/dist/catalog/fal/eleven-v4-tts.model.js +38 -0
- package/dist/catalog/fal/flux-3-video.model.d.ts +2 -0
- package/dist/catalog/fal/flux-3-video.model.js +187 -0
- package/dist/catalog/fal/flux-3.model.d.ts +2 -0
- package/dist/catalog/fal/flux-3.model.js +69 -0
- package/dist/catalog/fal/gemini-omni-1.2-flash.model.d.ts +2 -0
- package/dist/catalog/fal/gemini-omni-1.2-flash.model.js +129 -0
- package/dist/catalog/fal/gemini-omni-flash.model.js +1 -1
- package/dist/catalog/fal/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/fal/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/fal/gpt-image-2.6.model.js +97 -0
- package/dist/catalog/fal/gpt-image-2.model.js +1 -1
- package/dist/catalog/fal/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/fal/grok-imagine-video-1.5.model.d.ts +2 -0
- package/dist/catalog/fal/grok-imagine-video-1.5.model.js +121 -0
- package/dist/catalog/fal/hailuo-02.model.js +8 -4
- package/dist/catalog/fal/hailuo-2.3.model.js +1 -1
- package/dist/catalog/fal/ic-light-v2.model.js +1 -1
- package/dist/catalog/fal/ideogram-upscale.model.js +1 -1
- package/dist/catalog/fal/kling-3.0-omni.model.js +1 -1
- package/dist/catalog/fal/kling-3.0-turbo.model.js +5 -2
- package/dist/catalog/fal/kling-3.0.model.js +4 -1
- package/dist/catalog/fal/kling-4.0-flash.model.d.ts +2 -0
- package/dist/catalog/fal/kling-4.0-flash.model.js +132 -0
- package/dist/catalog/fal/kling-4.0.model.d.ts +2 -0
- package/dist/catalog/fal/kling-4.0.model.js +169 -0
- package/dist/catalog/fal/kling-image-o1.model.js +1 -1
- package/dist/catalog/fal/kling-video-o1.model.js +18 -7
- package/dist/catalog/fal/kling-video-v2.6-pro.model.js +3 -2
- package/dist/catalog/fal/ltx-2.3.model.d.ts +2 -0
- package/dist/catalog/fal/ltx-2.3.model.js +223 -0
- package/dist/catalog/fal/ltx-2.model.js +2 -1
- package/dist/catalog/fal/minimax-h3-max.model.d.ts +2 -0
- package/dist/catalog/fal/minimax-h3-max.model.js +132 -0
- package/dist/catalog/fal/minimax-h3.model.js +3 -4
- package/dist/catalog/fal/minimax-speech-2.8.model.js +1 -1
- package/dist/catalog/fal/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/fal/nano-banana-2.1.model.js +68 -0
- package/dist/catalog/fal/nano-banana-2.model.js +1 -1
- package/dist/catalog/fal/nano-banana-pro.model.js +1 -1
- package/dist/catalog/fal/nano-banana.model.js +1 -1
- package/dist/catalog/fal/pixverse-v5.5.model.js +9 -4
- package/dist/catalog/fal/qwen-image-3.0.model.js +2 -2
- package/dist/catalog/fal/qwen3-tts-1.7b.model.js +4 -3
- package/dist/catalog/fal/seedance-2.0-fast.model.js +1 -1
- package/dist/catalog/fal/seedance-2.0-mini.model.js +1 -1
- package/dist/catalog/fal/seedance-2.0.model.js +1 -1
- package/dist/catalog/fal/seedance-2.5.model.js +5 -2
- package/dist/catalog/fal/seedance.model.js +3 -2
- package/dist/catalog/fal/seedream-5.0-lite.model.js +1 -1
- package/dist/catalog/fal/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/fal/seedream-v4.5.model.js +1 -1
- package/dist/catalog/fal/seedream-v4.model.js +1 -1
- package/dist/catalog/fal/seedvr2-image-upscale.model.js +1 -1
- package/dist/catalog/fal/topaz-image-upscale.model.js +1 -1
- package/dist/catalog/fal/topaz-transparent-upscale.model.js +1 -1
- package/dist/catalog/fal/utils/klingV4.d.ts +17 -0
- package/dist/catalog/fal/utils/klingV4.js +33 -0
- package/dist/catalog/fal/veo-3.1.model.js +5 -2
- package/dist/catalog/fal/vidu-q2.model.js +20 -8
- package/dist/catalog/fal/wan-2.5-preview.model.js +4 -1
- package/dist/catalog/fal/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/fal/wan-3.0.model.js +135 -0
- package/dist/catalog/fal/z-image-turbo.model.js +10 -9
- package/dist/catalog/grsai/gpt-image-2.5.model.js +13 -31
- package/dist/catalog/grsai/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/grsai/gpt-image-2.6.model.js +37 -0
- package/dist/catalog/grsai/gpt-image-2.model.js +5 -2
- package/dist/catalog/grsai/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/grsai/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/grsai/nano-banana-2.1.model.js +29 -0
- package/dist/catalog/grsai/nano-banana-2.model.js +1 -1
- package/dist/catalog/grsai/nano-banana-pro.model.js +1 -1
- package/dist/catalog/grsai/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/grsai/wan-3.0.model.js +78 -0
- package/dist/catalog/index.d.ts +1 -0
- package/dist/catalog/index.js +205 -124
- package/dist/catalog/kie/eleven-v3-dialogue.model.js +1 -1
- package/dist/catalog/kie/flux-3-klein.model.d.ts +2 -0
- package/dist/catalog/kie/flux-3-klein.model.js +58 -0
- package/dist/catalog/kie/gemini-3.1-flash-tts.model.js +7 -4
- package/dist/catalog/kie/gemini-3.8-flash-lite-tts.model.d.ts +2 -0
- package/dist/catalog/kie/gemini-3.8-flash-lite-tts.model.js +11 -0
- package/dist/catalog/kie/gemini-3.8-flash-tts.model.d.ts +2 -0
- package/dist/catalog/kie/gemini-3.8-flash-tts.model.js +11 -0
- package/dist/catalog/kie/gemini-omni-video.model.js +8 -30
- package/dist/catalog/kie/gemini38Tts.d.ts +3 -0
- package/dist/catalog/kie/gemini38Tts.js +40 -0
- package/dist/catalog/kie/gpt-image-2.5.model.js +1 -1
- package/dist/catalog/kie/gpt-image-2.6.model.d.ts +2 -0
- package/dist/catalog/kie/gpt-image-2.6.model.js +87 -0
- package/dist/catalog/kie/gpt-image-2.model.js +8 -12
- package/dist/catalog/kie/grok-imagine-2.0.model.js +1 -1
- package/dist/catalog/kie/grok-imagine-video-1.5.model.d.ts +2 -0
- package/dist/catalog/kie/grok-imagine-video-1.5.model.js +52 -0
- package/dist/catalog/kie/grok-imagine-video.model.js +7 -3
- package/dist/catalog/kie/grok-imagine.model.js +4 -2
- package/dist/catalog/kie/hailuo-02.model.js +6 -4
- package/dist/catalog/kie/hailuo-2-3.model.js +1 -1
- package/dist/catalog/kie/happyhorse-1.1.model.js +5 -2
- package/dist/catalog/kie/kling-3.0-omni.model.js +51 -23
- package/dist/catalog/kie/kling-3.0-turbo.model.js +1 -1
- package/dist/catalog/kie/kling-3.0.model.js +1 -8
- package/dist/catalog/kie/kling-4.0-flash.model.d.ts +2 -0
- package/dist/catalog/kie/kling-4.0-flash.model.js +16 -0
- package/dist/catalog/kie/kling-4.0.model.d.ts +2 -0
- package/dist/catalog/kie/kling-4.0.model.js +17 -0
- package/dist/catalog/kie/kling-v2-6.model.js +1 -1
- package/dist/catalog/kie/kling40.d.ts +21 -0
- package/dist/catalog/kie/kling40.js +129 -0
- package/dist/catalog/kie/minimax-h3.model.js +16 -21
- package/dist/catalog/kie/nano-banana-2-lite.model.js +1 -1
- package/dist/catalog/kie/nano-banana-2.1.model.d.ts +2 -0
- package/dist/catalog/kie/nano-banana-2.1.model.js +34 -0
- package/dist/catalog/kie/nano-banana-2.model.js +2 -2
- package/dist/catalog/kie/nano-banana-pro.model.js +1 -1
- package/dist/catalog/kie/qwen-image-3.0.model.js +2 -10
- package/dist/catalog/kie/seedance-1.5-pro.model.js +2 -1
- package/dist/catalog/kie/seedance-2.0-fast.model.js +5 -1
- package/dist/catalog/kie/seedance-2.0-mini.model.js +5 -1
- package/dist/catalog/kie/seedance-2.0.model.js +5 -1
- package/dist/catalog/kie/seedance-2.5.model.js +10 -20
- package/dist/catalog/kie/seedance-v1.model.js +8 -4
- package/dist/catalog/kie/seedream-4.0.model.js +1 -1
- package/dist/catalog/kie/seedream-4.5.model.js +1 -1
- package/dist/catalog/kie/seedream-5.0-lite.model.js +1 -1
- package/dist/catalog/kie/seedream-5.0-pro.model.js +1 -1
- package/dist/catalog/kie/wan-3.0-prime.model.d.ts +2 -0
- package/dist/catalog/kie/wan-3.0-prime.model.js +15 -0
- package/dist/catalog/kie/wan-3.0.model.d.ts +2 -0
- package/dist/catalog/kie/wan-3.0.model.js +15 -0
- package/dist/catalog/kie/wan30.d.ts +10 -0
- package/dist/catalog/kie/wan30.js +78 -0
- package/dist/catalog/kie/z-image.model.js +1 -1
- package/dist/catalog/modelscope/flux-1-krea-dev.model.js +4 -2
- package/dist/catalog/modelscope/majicmix-realistic.model.js +3 -2
- package/dist/catalog/modelscope/modelscope-custom.model.js +3 -2
- package/dist/catalog/modelscope/qwen-image-2512.model.d.ts +5 -0
- package/dist/catalog/modelscope/{qwen-image.model.js → qwen-image-2512.model.js} +11 -8
- package/dist/catalog/modelscope/qwen-image-edit-2511.model.d.ts +5 -0
- package/dist/catalog/modelscope/{qwen-image-edit-2509.model.js → qwen-image-edit-2511.model.js} +9 -7
- package/dist/catalog/modelscope/sdxl-14-ckpt.model.js +3 -2
- package/dist/catalog/modelscope/utils.js +2 -2
- package/dist/catalog/modelscope/z-image-turbo.model.js +3 -2
- package/dist/catalog/ppio/kling-3.0.model.js +4 -1
- package/dist/catalog/ppio/minimax-speech.model.js +2 -1
- package/dist/catalog/shared/mediaPresence.d.ts +8 -1
- package/dist/catalog/shared/mediaPresence.js +21 -1
- package/dist/catalog/shared/nanoBanana21.d.ts +11 -0
- package/dist/catalog/shared/nanoBanana21.js +30 -0
- package/dist/catalog/shared/shotList.d.ts +31 -0
- package/dist/catalog/shared/shotList.js +48 -0
- package/dist/catalog/shared/subjectElements.d.ts +36 -0
- package/dist/catalog/shared/subjectElements.js +93 -0
- package/dist/catalog/siliconflow/moss-ttsd-0.5.model.js +1 -1
- package/dist/catalog/validate.js +14 -1
- package/dist/catalog/volcengine/seedance-2.0-fast.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0-fast.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.0-mini.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0-mini.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.0.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.0.model.js +11 -0
- package/dist/catalog/volcengine/seedance-2.5.model.d.ts +2 -0
- package/dist/catalog/volcengine/seedance-2.5.model.js +11 -0
- package/dist/catalog/volcengine/seedance.d.ts +17 -0
- package/dist/catalog/volcengine/seedance.js +192 -0
- package/dist/catalog/volcengine/seedream-5.0-lite.model.js +2 -1
- package/dist/catalog/volcengine/seedream-5.0.js +1 -1
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.d.ts +1 -0
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.js +52 -10
- package/dist/catalog/volcengine-speech/seed-tts-2.0-voices.d.ts +2 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0-voices.js +438 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0.model.js +4 -4
- package/dist/discovery/index.js +13 -6
- package/dist/generation/core.d.ts +6 -0
- package/dist/generation/core.js +10 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/llm/bigmodel/preset.js +2 -1
- package/dist/llm/bigmodel/profiles.js +0 -6
- package/dist/llm/chat.d.ts +8 -0
- package/dist/llm/chat.js +18 -2
- package/dist/llm/chatTypes.d.ts +6 -0
- package/dist/llm/defaults.d.ts +2 -2
- package/dist/llm/defaults.js +3 -3
- package/dist/llm/groq/preset.js +18 -2
- package/dist/llm/modelCatalog.d.ts +9 -2
- package/dist/llm/modelCatalog.js +17 -4
- package/dist/llm/modelCatalogEntries.d.ts +2 -0
- package/dist/llm/modelCatalogEntries.js +197 -42
- package/dist/llm/providerPresets.d.ts +3 -0
- package/dist/llm/providerPresets.js +145 -32
- package/dist/llm/providerReasoningRequest.js +28 -11
- package/dist/llm/siliconflow/index.js +1 -1
- package/dist/llm/siliconflow/preset.js +30 -0
- package/dist/llm/types.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.5-preview.d.ts → apimart/flux-3-image.d.ts} +1 -1
- package/dist/packs/models/apimart/flux-3-image.js +7 -0
- package/dist/packs/models/apimart/flux-3-video.d.ts +6 -0
- package/dist/packs/models/apimart/flux-3-video.js +7 -0
- package/dist/packs/models/apimart/gemini-omni-1.2-flash.d.ts +6 -0
- package/dist/packs/models/apimart/gemini-omni-1.2-flash.js +7 -0
- package/dist/packs/models/{modelscope/qwen-image.d.ts → apimart/gpt-image-2.6.d.ts} +1 -1
- package/dist/packs/models/apimart/gpt-image-2.6.js +7 -0
- package/dist/packs/models/apimart/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/apimart/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/apimart/happyhorse-1.1.d.ts +6 -0
- package/dist/packs/models/apimart/happyhorse-1.1.js +7 -0
- package/dist/packs/models/apimart/kling-4.0.d.ts +6 -0
- package/dist/packs/models/apimart/kling-4.0.js +7 -0
- package/dist/packs/models/apimart/minimax-h3-max.d.ts +6 -0
- package/dist/packs/models/apimart/minimax-h3-max.js +7 -0
- package/dist/packs/models/{ppio/minimax-hailuo-2.3.d.ts → apimart/nano-banana-2.1.d.ts} +1 -1
- package/dist/packs/models/{ppio/minimax-hailuo-2.3.js → apimart/nano-banana-2.1.js} +4 -4
- package/dist/packs/models/apimart/seedream-5.0-flash.d.ts +6 -0
- package/dist/packs/models/apimart/seedream-5.0-flash.js +7 -0
- package/dist/packs/models/apimart/veo-3.1.d.ts +6 -0
- package/dist/packs/models/apimart/veo-3.1.js +7 -0
- package/dist/packs/models/apimart/wan-2.7-image.d.ts +6 -0
- package/dist/packs/models/apimart/wan-2.7-image.js +7 -0
- package/dist/packs/models/apimart/wan-3.0.d.ts +6 -0
- package/dist/packs/models/apimart/wan-3.0.js +7 -0
- package/dist/packs/models/bailian/cosyvoice-v3.5.js +1 -1
- package/dist/packs/models/bailian/minimax-h3.d.ts +6 -0
- package/dist/packs/models/bailian/minimax-h3.js +7 -0
- package/dist/packs/models/bailian/minimax-speech-2.8.js +1 -1
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-flash.js +1 -1
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-plus.d.ts +6 -0
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-plus.js +7 -0
- package/dist/packs/models/bailian/qwen-image-3.0.js +1 -1
- package/dist/packs/models/bailian/wan-3.0.d.ts +6 -0
- package/dist/packs/models/bailian/wan-3.0.js +7 -0
- package/dist/packs/models/bailian/z-image-turbo.js +1 -1
- package/dist/packs/models/fal/eleven-v4-tts.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.5-preview.js → fal/eleven-v4-tts.js} +4 -4
- package/dist/packs/models/fal/flux-3-video.d.ts +6 -0
- package/dist/packs/models/fal/flux-3-video.js +7 -0
- package/dist/packs/models/{ppio/wan-2.6.d.ts → fal/flux-3.d.ts} +1 -1
- package/dist/packs/models/{ppio/wan-2.6.js → fal/flux-3.js} +4 -4
- package/dist/packs/models/fal/gemini-omni-1.2-flash.d.ts +6 -0
- package/dist/packs/models/fal/gemini-omni-1.2-flash.js +7 -0
- package/dist/packs/models/fal/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/fal/gpt-image-2.6.js +7 -0
- package/dist/packs/models/fal/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/fal/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/fal/kling-4.0-flash.d.ts +6 -0
- package/dist/packs/models/fal/kling-4.0-flash.js +7 -0
- package/dist/packs/models/fal/kling-4.0.d.ts +6 -0
- package/dist/packs/models/{ppio/wan-2.7.js → fal/kling-4.0.js} +4 -4
- package/dist/packs/models/{ppio/wan-2.7.d.ts → fal/ltx-2.3.d.ts} +1 -1
- package/dist/packs/models/fal/ltx-2.3.js +7 -0
- package/dist/packs/models/fal/minimax-h3-max.d.ts +6 -0
- package/dist/packs/models/fal/minimax-h3-max.js +7 -0
- package/dist/packs/models/fal/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/fal/nano-banana-2.1.js +7 -0
- package/dist/packs/models/fal/wan-3.0.d.ts +6 -0
- package/dist/packs/models/fal/wan-3.0.js +7 -0
- package/dist/packs/models/grsai/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/grsai/gpt-image-2.6.js +7 -0
- package/dist/packs/models/grsai/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/grsai/nano-banana-2.1.js +7 -0
- package/dist/packs/models/grsai/wan-3.0.d.ts +6 -0
- package/dist/packs/models/grsai/wan-3.0.js +7 -0
- package/dist/packs/models/kie/flux-3-klein.d.ts +6 -0
- package/dist/packs/models/kie/flux-3-klein.js +7 -0
- package/dist/packs/models/kie/gemini-3.8-flash-lite-tts.d.ts +6 -0
- package/dist/packs/models/kie/gemini-3.8-flash-lite-tts.js +7 -0
- package/dist/packs/models/kie/{eleven-turbo-2.5-tts.d.ts → gemini-3.8-flash-tts.d.ts} +1 -1
- package/dist/packs/models/kie/{eleven-turbo-2.5-tts.js → gemini-3.8-flash-tts.js} +1 -1
- package/dist/packs/models/kie/gpt-image-2.6.d.ts +6 -0
- package/dist/packs/models/kie/gpt-image-2.6.js +7 -0
- package/dist/packs/models/kie/grok-imagine-video-1.5.d.ts +6 -0
- package/dist/packs/models/kie/grok-imagine-video-1.5.js +7 -0
- package/dist/packs/models/kie/kling-4.0-flash.d.ts +6 -0
- package/dist/packs/models/kie/kling-4.0-flash.js +7 -0
- package/dist/packs/models/kie/kling-4.0.d.ts +6 -0
- package/dist/packs/models/kie/kling-4.0.js +7 -0
- package/dist/packs/models/kie/nano-banana-2.1.d.ts +6 -0
- package/dist/packs/models/kie/nano-banana-2.1.js +7 -0
- package/dist/packs/models/kie/wan-3.0-prime.d.ts +6 -0
- package/dist/packs/models/kie/wan-3.0-prime.js +7 -0
- package/dist/packs/models/kie/wan-3.0.d.ts +6 -0
- package/dist/packs/models/kie/wan-3.0.js +7 -0
- package/dist/packs/models/modelscope/flux-1-krea-dev.js +1 -1
- package/dist/packs/models/modelscope/majicmix-realistic.js +1 -1
- package/dist/packs/models/modelscope/modelscope-custom.js +1 -1
- package/dist/packs/models/modelscope/qwen-image-2512.d.ts +6 -0
- package/dist/packs/models/modelscope/{qwen-image.js → qwen-image-2512.js} +2 -2
- package/dist/packs/models/modelscope/{qwen-image-edit-2509.d.ts → qwen-image-edit-2511.d.ts} +1 -1
- package/dist/packs/models/modelscope/{qwen-image-edit-2509.js → qwen-image-edit-2511.js} +2 -2
- package/dist/packs/models/modelscope/sdxl-14-ckpt.js +1 -1
- package/dist/packs/models/modelscope/z-image-turbo.js +1 -1
- package/dist/packs/models/volcengine/seedance-2.0-fast.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0-fast.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.0-mini.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0-mini.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.0.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.0.js +7 -0
- package/dist/packs/models/volcengine/seedance-2.5.d.ts +6 -0
- package/dist/packs/models/volcengine/seedance-2.5.js +7 -0
- package/dist/packs/models/volcengine/seedream-5.0-flash.js +1 -1
- package/dist/packs/models/volcengine/seedream-5.0-lite.js +1 -1
- package/dist/packs/models/volcengine/seedream-5.0-pro.js +1 -1
- package/dist/packs/provider-adapters/bailian.js +1 -1
- package/dist/packs/provider-adapters/modelscope.js +1 -1
- package/dist/packs/provider-adapters/volcengine.js +1 -1
- package/dist/packs/provider-packs/apimart.d.ts +1 -1
- package/dist/packs/provider-packs/apimart.js +35 -22
- package/dist/packs/provider-packs/bailian.d.ts +1 -1
- package/dist/packs/provider-packs/bailian.js +8 -5
- package/dist/packs/provider-packs/fal.d.ts +1 -1
- package/dist/packs/provider-packs/fal.js +52 -40
- package/dist/packs/provider-packs/grsai.d.ts +1 -1
- package/dist/packs/provider-packs/grsai.js +8 -5
- package/dist/packs/provider-packs/kie.d.ts +1 -1
- package/dist/packs/provider-packs/kie.js +41 -32
- package/dist/packs/provider-packs/modelscope.js +2 -2
- package/dist/packs/provider-packs/ppio.d.ts +1 -1
- package/dist/packs/provider-packs/ppio.js +2 -6
- package/dist/packs/provider-packs/volcengine.d.ts +1 -1
- package/dist/packs/provider-packs/volcengine.js +8 -4
- package/dist/pricing/index.d.ts +1 -0
- package/dist/pricing/index.js +1 -0
- package/dist/pricing/mediaContext.d.ts +6 -1
- package/dist/pricing/mediaContext.js +12 -5
- package/dist/pricing/tokenPricing.d.ts +36 -0
- package/dist/pricing/tokenPricing.js +26 -0
- package/dist/providers/bailian.d.ts +1 -1
- package/dist/providers/bailian.js +71 -4
- package/dist/providers/fal.js +11 -1
- package/dist/providers/helpers.d.ts +1 -1
- package/dist/providers/helpers.js +17 -5
- package/dist/providers/kie.js +16 -5
- package/dist/providers/metadata.js +2 -2
- package/dist/providers/openai-speech.d.ts +6 -0
- package/dist/providers/openai-speech.js +31 -0
- package/dist/providers/providerAccessErrors.d.ts +3 -0
- package/dist/providers/providerAccessErrors.js +73 -0
- package/dist/providers/siliconflow.js +2 -27
- package/dist/providers/volcengine-speech.d.ts +1 -1
- package/dist/providers/volcengine-speech.js +31 -8
- package/dist/providers/volcengine-voice-clone.d.ts +3 -0
- package/dist/providers/volcengine-voice-clone.js +138 -0
- package/dist/providers/volcengine.d.ts +1 -1
- package/dist/providers/volcengine.js +89 -11
- package/dist/runtime/retry.js +3 -0
- package/dist/tool-packs/fal-erase/models/bria-eraser.model.js +1 -1
- package/dist/tool-packs/fal-erase/models/finegrain-eraser.model.js +1 -1
- package/dist/tool-packs/fal-erase/models/flux-pro-erase.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/control-light.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/outpaint.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/photo-restoration.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/pixelcut-background-removal.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/product-photography.model.js +1 -1
- package/dist/tool-packs/fal-image-utilities/models/relighting.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/flux-2-multiple-angles.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/perspective-change.model.js +1 -1
- package/dist/tool-packs/fal-multi-angle/models/qwen-image-edit-2511-multiple-angles.model.js +1 -1
- package/dist/types/model.d.ts +68 -12
- package/dist/types/model.js +3 -0
- package/dist/types/modelTags.d.ts +142 -0
- package/dist/types/modelTags.js +44 -0
- package/dist/types/runtime.d.ts +3 -0
- package/dist/types/speechTimings.d.ts +15 -0
- package/dist/types/speechTimings.js +1 -0
- package/dist/upload/apimart-upload.d.ts +1 -1
- package/dist/upload/apimart-upload.js +37 -15
- package/dist/upload/bailian-oss-upload.d.ts +32 -0
- package/dist/upload/bailian-oss-upload.js +74 -0
- package/dist/upload/{fal-legacy.js → fal-host-fetch.js} +2 -2
- package/dist/upload/fal-transport.d.ts +6 -0
- package/dist/upload/fal-transport.js +2 -1
- package/dist/upload/index.d.ts +2 -2
- package/dist/upload/index.js +4 -7
- package/dist/upload/kie-upload.d.ts +1 -1
- package/dist/upload/kie-upload.js +34 -12
- package/dist/upload/media-binary.js +1 -0
- package/dist/upload/media-fields.js +7 -2
- package/dist/upload/preprocess-core.d.ts +2 -0
- package/dist/upload/preprocess-core.js +2 -0
- package/dist/upload/preprocess.d.ts +1 -1
- package/dist/upload/preprocess.js +12 -3
- package/dist/upload/provider-preprocessors/apimart.d.ts +1 -1
- package/dist/upload/provider-preprocessors/apimart.js +13 -5
- package/dist/upload/provider-preprocessors/bailian.d.ts +8 -0
- package/dist/upload/provider-preprocessors/bailian.js +45 -0
- package/dist/upload/provider-preprocessors/kie.d.ts +1 -1
- package/dist/upload/provider-preprocessors/kie.js +26 -9
- package/dist/upload/provider-preprocessors/ppio.d.ts +1 -2
- package/dist/upload/provider-preprocessors/ppio.js +2 -29
- package/dist/upload/provider-preprocessors/public-host.d.ts +5 -0
- package/dist/upload/provider-preprocessors/public-host.js +7 -0
- package/dist/upload/provider-preprocessors/volcengine.d.ts +5 -0
- package/dist/upload/provider-preprocessors/volcengine.js +10 -0
- package/dist/upload/public-host-upload.d.ts +7 -0
- package/dist/upload/public-host-upload.js +55 -0
- package/dist/upload/upload-response.js +12 -7
- package/docs/README.md +26 -26
- package/docs/consumers.md +150 -124
- package/docs/llm-adaptation/README.md +180 -166
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/DeepSeek.md +108 -104
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/Kimi.md +94 -76
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/MiniMax.md +89 -84
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//345/260/217/347/261/263MiMo.md +126 -126
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//346/231/272/350/260/261GLM.md +238 -234
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +131 -87
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274Qwen.md +112 -84
- package/docs/llm-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +88 -88
- package/docs/model-adaptation/Bria-Eraser/Bria-Eraser_Fal.md +32 -32
- package/docs/model-adaptation/Bria-/345/210/233/346/204/217/346/224/276/345/244/247/Bria-/345/210/233/346/204/217/346/224/276/345/244/247_Fal.md +31 -31
- package/docs/model-adaptation/ControlLight/ControlLight_Fal.md +85 -85
- package/docs/model-adaptation/Eleven-v4/Eleven-v4_Fal.md +49 -0
- package/docs/model-adaptation/FLUX-2-/345/244/232/350/247/222/345/272/246/FLUX-2-/345/244/232/350/247/222/345/272/246_Fal.md +107 -107
- package/docs/model-adaptation/FLUX-3/FLUX-3_APIMart.md +65 -0
- package/docs/model-adaptation/FLUX-3/FLUX-3_Fal.md +48 -0
- package/docs/model-adaptation/FLUX-3-Klein/FLUX-3-Klein_KIE.md +38 -0
- package/docs/model-adaptation/FLUX-3-Video/FLUX-3-Video_APIMart.md +84 -0
- package/docs/model-adaptation/FLUX-3-Video/FLUX-3-Video_Fal.md +80 -0
- package/docs/model-adaptation/Finegrain-Eraser/Finegrain-Eraser_Fal.md +31 -31
- package/docs/model-adaptation/Flux-Pro-Erase/Flux-Pro-Erase_Fal.md +34 -34
- package/docs/model-adaptation/Fun-ASR/Fun-ASR_/347/231/276/347/202/274.md +47 -47
- package/docs/model-adaptation/Fun-ASR-Flash-2026-06-15/Fun-ASR-Flash-2026-06-15_/347/231/276/347/202/274.md +45 -45
- package/docs/model-adaptation/Fun-ASR-Realtime/Fun-ASR-Realtime_/347/231/276/347/202/274.md +57 -57
- package/docs/model-adaptation/Fun-ASR-Realtime-2026-02-28/Fun-ASR-Realtime-2026-02-28_/347/231/276/347/202/274.md +39 -39
- package/docs/model-adaptation/GLM-5.3-Flash/GLM-5.3-Flash_/346/231/272/350/260/261.md +217 -213
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_APIMart.md +173 -173
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Fal.md +94 -94
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_Grsai.md +138 -137
- package/docs/model-adaptation/GPT-Image-2/GPT-Image-2_KIE.md +97 -93
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_APIMart.md +66 -66
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Fal.md +55 -55
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Grsai.md +59 -53
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_KIE.md +55 -55
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_APIMart.md +101 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_Fal.md +55 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_Grsai.md +32 -0
- package/docs/model-adaptation/GPT-Image-2.6/GPT-Image-2.6_KIE.md +51 -0
- package/docs/model-adaptation/GPT-OSS-20B/GPT-OSS-20B_Groq.md +62 -62
- package/docs/model-adaptation/Gemini-3.8-Flash-Lite-TTS/Gemini-3.8-Flash-Lite-TTS_KIE.md +22 -0
- package/docs/model-adaptation/Gemini-3.8-Flash-TTS/Gemini-3.8-Flash-TTS_KIE.md +38 -0
- package/docs/model-adaptation/Gemini-Omni-1.2-Flash/Gemini-Omni-1.2-Flash_APIMart.md +79 -0
- package/docs/model-adaptation/Gemini-Omni-1.2-Flash/Gemini-Omni-1.2-Flash_Fal.md +60 -0
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_APIMart.md +131 -124
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_Fal.md +84 -84
- package/docs/model-adaptation/Gemini-Omni-Flash/Gemini-Omni-Flash_KIE.md +132 -129
- package/docs/model-adaptation/Grok-Imagine/Grok-Imagine_KIE.md +38 -36
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_APIMart.md +250 -250
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_Fal.md +84 -84
- package/docs/model-adaptation/Grok-Imagine-2.0/Grok-Imagine-2.0_KIE.md +105 -105
- package/docs/model-adaptation/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_APIMart.md +68 -0
- package/docs/model-adaptation/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_Fal.md +47 -0
- package/docs/model-adaptation/Grok-Imagine-Video-1.5/Grok-Imagine-Video-1.5_KIE.md +37 -0
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_Fal.md +95 -93
- package/docs/model-adaptation/Hailuo-02/Hailuo-02_KIE.md +58 -56
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_Fal.md +88 -88
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_KIE.md +51 -51
- package/docs/model-adaptation/HappyHorse-1.1/HappyHorse-1.1_APIMart.md +66 -0
- package/docs/model-adaptation/HappyHorse-1.1/HappyHorse-1.1_KIE.md +31 -27
- package/docs/model-adaptation/IC-Light-v2/IC-Light-v2_Fal.md +99 -99
- package/docs/model-adaptation/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247/Ideogram-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +41 -41
- package/docs/model-adaptation/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261/Image-Apps-v2-/345/225/206/345/223/201/346/221/204/345/275/261_Fal.md +72 -72
- package/docs/model-adaptation/Image-Apps-v2-/346/211/251/345/233/276/Image-Apps-v2-/346/211/251/345/233/276_Fal.md +93 -93
- package/docs/model-adaptation/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215/Image-Apps-v2-/347/205/247/347/211/207/344/277/256/345/244/215_Fal.md +86 -86
- package/docs/model-adaptation/Image-Apps-v2-/351/207/215/346/211/223/345/205/211/Image-Apps-v2-/351/207/215/346/211/223/345/205/211_Fal.md +84 -84
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_APIMart.md +112 -112
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_Fal.md +91 -89
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_KIE.md +106 -106
- package/docs/model-adaptation/Kling-3.0/Kling-3.0_/346/264/276/346/254/247/344/272/221.md +120 -119
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_APIMart.md +130 -125
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_Fal.md +107 -107
- package/docs/model-adaptation/Kling-3.0-Omni/Kling-3.0-Omni_KIE.md +148 -143
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_APIMart.md +88 -85
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_Fal.md +86 -83
- package/docs/model-adaptation/Kling-3.0-Turbo/Kling-3.0-Turbo_KIE.md +84 -84
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_APIMart.md +76 -0
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_Fal.md +115 -0
- package/docs/model-adaptation/Kling-4.0/Kling-4.0_KIE.md +61 -0
- package/docs/model-adaptation/Kling-4.0-Flash/Kling-4.0-Flash_Fal.md +55 -0
- package/docs/model-adaptation/Kling-4.0-Flash/Kling-4.0-Flash_KIE.md +33 -0
- package/docs/model-adaptation/LTX-2.3/LTX-2.3_Fal.md +121 -0
- package/docs/model-adaptation/Midjourney/Midjourney_APIMart.md +402 -396
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_APIMart.md +237 -234
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_Fal.md +112 -108
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_KIE.md +118 -111
- package/docs/model-adaptation/MiniMax-H3/MiniMax-H3_/347/231/276/347/202/274.md +65 -0
- package/docs/model-adaptation/MiniMax-H3-Max/MiniMax-H3-Max_APIMart.md +78 -0
- package/docs/model-adaptation/MiniMax-H3-Max/MiniMax-H3-Max_Fal.md +62 -0
- package/docs/model-adaptation/MiniMax-Speech/MiniMax-Speech_/346/264/276/346/254/247/344/272/221.md +170 -170
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_APIMart.md +89 -89
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Fal.md +99 -99
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-2/Nano-Banana-2_KIE.md +72 -70
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_APIMart.md +79 -79
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_Grsai.md +65 -65
- package/docs/model-adaptation/Nano-Banana-2-Lite/Nano-Banana-2-Lite_KIE.md +64 -64
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_APIMart.md +35 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_Fal.md +37 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_Grsai.md +35 -0
- package/docs/model-adaptation/Nano-Banana-2.1/Nano-Banana-2.1_KIE.md +36 -0
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_APIMart.md +83 -83
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Fal.md +89 -89
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_Grsai.md +82 -82
- package/docs/model-adaptation/Nano-Banana-Pro/Nano-Banana-Pro_KIE.md +64 -64
- package/docs/model-adaptation/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244/Pixelcut-/350/203/214/346/231/257/347/247/273/351/231/244_Fal.md +79 -79
- package/docs/model-adaptation/Qwen-Audio-3.1-TTS-Plus/Qwen-Audio-3.1-TTS-Plus_/347/231/276/347/202/274.md +59 -0
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_APIMart.md +117 -117
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_Fal.md +85 -84
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_KIE.md +103 -103
- package/docs/model-adaptation/Qwen-Image-3.0/Qwen-Image-3.0_/347/231/276/347/202/274.md +138 -138
- package/docs/model-adaptation/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246/Qwen-Image-Edit-2511-/345/244/232/350/247/222/345/272/246_Fal.md +57 -57
- package/docs/model-adaptation/Qwen-MT-Flash/Qwen-MT-Flash_/347/231/276/347/202/274.md +68 -68
- package/docs/model-adaptation/Qwen-MT-Lite/Qwen-MT-Lite_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen-MT-Plus/Qwen-MT-Plus_/347/231/276/347/202/274.md +40 -40
- package/docs/model-adaptation/Qwen3-ASR-Flash/Qwen3-ASR-Flash_/347/231/276/347/202/274.md +44 -44
- package/docs/model-adaptation/Qwen3-ASR-Flash-2026-02-10/Qwen3-ASR-Flash-2026-02-10_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/Qwen3-ASR-Flash-Filetrans/Qwen3-ASR-Flash-Filetrans_/347/231/276/347/202/274.md +45 -45
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime/Qwen3-ASR-Flash-Realtime_/347/231/276/347/202/274.md +58 -58
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime-2026-02-10/Qwen3-ASR-Flash-Realtime-2026-02-10_/347/231/276/347/202/274.md +37 -37
- package/docs/model-adaptation/README.md +371 -328
- package/docs/model-adaptation/Seed-ICL-2.0/Seed-ICL-2.0_/347/201/253/345/261/261/345/274/225/346/223/216.md +65 -0
- package/docs/model-adaptation/SeedASR-2.0-File/SeedASR-2.0-File_/347/201/253/345/261/261/345/274/225/346/223/216.md +115 -115
- package/docs/model-adaptation/SeedASR-2.0-Realtime/SeedASR-2.0-Realtime_/347/201/253/345/261/261/345/274/225/346/223/216.md +147 -147
- package/docs/model-adaptation/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247/SeedVR2-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +45 -45
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_APIMart.md +121 -121
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_Fal.md +97 -97
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_KIE.md +87 -86
- package/docs/model-adaptation/Seedance-2.0/Seedance-2.0_/347/201/253/345/261/261/345/274/225/346/223/216.md +101 -0
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_APIMart.md +89 -89
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_Fal.md +95 -95
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_KIE.md +79 -78
- package/docs/model-adaptation/Seedance-2.0-Fast/Seedance-2.0-Fast_/347/201/253/345/261/261/345/274/225/346/223/216.md +98 -0
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_APIMart.md +93 -89
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_Fal.md +96 -96
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_KIE.md +79 -78
- package/docs/model-adaptation/Seedance-2.0-Mini/Seedance-2.0-Mini_/347/201/253/345/261/261/345/274/225/346/223/216.md +98 -0
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_APIMart.md +217 -212
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_Fal.md +98 -94
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_KIE.md +94 -89
- package/docs/model-adaptation/Seedance-2.5/Seedance-2.5_/347/201/253/345/261/261/345/274/225/346/223/216.md +102 -0
- package/docs/model-adaptation/Seedream-5.0-Flash/Seedream-5.0-Flash_APIMart.md +64 -0
- package/docs/model-adaptation/Seedream-5.0-Flash/Seedream-5.0-Flash_/347/201/253/345/261/261/345/274/225/346/223/216.md +18 -18
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_APIMart.md +113 -106
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_Fal.md +91 -91
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_KIE.md +89 -89
- package/docs/model-adaptation/Seedream-5.0-Lite/Seedream-5.0-Lite_/347/201/253/345/261/261/345/274/225/346/223/216.md +110 -108
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_APIMart.md +194 -194
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_Fal.md +100 -100
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_KIE.md +141 -141
- package/docs/model-adaptation/Seedream-5.0-Pro/Seedream-5.0-Pro_/347/201/253/345/261/261/345/274/225/346/223/216.md +137 -137
- package/docs/model-adaptation/SenseVoiceSmall/SenseVoiceSmall_/347/241/205/345/237/272/346/265/201/345/212/250.md +73 -73
- package/docs/model-adaptation/TTS-/345/244/232/344/276/233/345/272/224/345/225/206-2026-09.md +52 -6
- package/docs/model-adaptation/TTS-/346/227/266/351/227/264/346/210/263-2026-10.md +36 -0
- package/docs/model-adaptation/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247/Topaz-/345/233/276/347/211/207/346/224/276/345/244/247_Fal.md +87 -87
- package/docs/model-adaptation/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247/Topaz-/351/200/217/346/230/216/345/233/276/346/224/276/345/244/247_Fal.md +34 -34
- package/docs/model-adaptation/Veo-3.1/Veo-3.1_APIMart.md +90 -0
- package/docs/model-adaptation/Wan-2.7-Image/Wan-2.7-Image_APIMart.md +81 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_APIMart.md +74 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_Fal.md +60 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_Grsai.md +35 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_KIE.md +38 -0
- package/docs/model-adaptation/Wan-3.0/Wan-3.0_/347/231/276/347/202/274.md +96 -0
- package/docs/model-adaptation/Wan-3.0-Prime/Wan-3.0-Prime_KIE.md +20 -0
- package/docs/model-adaptation/Whisper-Large-v3/Whisper-Large-v3_Groq.md +80 -80
- package/docs/model-adaptation/Whisper-Large-v3-Turbo/Whisper-Large-v3-Turbo_Groq.md +79 -79
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_APIMart.md +88 -88
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_Fal.md +103 -95
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_KIE.md +71 -71
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/347/231/276/347/202/274.md +122 -122
- package/docs/model-adaptation/Z-Image-Turbo/Z-Image-Turbo_/351/255/224/346/220/255.md +99 -97
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/APIMart.md +240 -240
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Fal.md +190 -172
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Groq.md +136 -121
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/Grsai.md +217 -217
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206/KIE.md +159 -131
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/200/231/351/200/211/344/276/233/345/272/224/345/225/206/350/260/203/347/240/224-/345/233/276/347/211/207/345/267/245/345/205/267.md +151 -151
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//345/277/253/351/200/237/351/200/202/351/205/215/344/276/233/345/272/224/345/225/206.md +65 -65
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//346/264/276/346/254/247/344/272/221.md +170 -147
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +191 -183
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274.md +339 -282
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/241/205/345/237/272/346/265/201/345/212/250.md +180 -153
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//351/255/224/346/220/255.md +205 -207
- package/docs/model-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +339 -338
- package/docs/model-adaptation//351/200/217/350/247/206/345/217/230/346/215/242//351/200/217/350/247/206/345/217/230/346/215/242_Fal.md +59 -59
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Electron.md +77 -77
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/Tauri.md +81 -81
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227/UXP.md +169 -169
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//344/276/233/345/272/224/345/225/206/345/237/237/345/220/215.md +83 -83
- package/docs//346/216/245/345/205/245/346/214/207/345/215/227//351/224/231/350/257/257/345/244/204/347/220/206.md +72 -72
- package/examples/form-renderer/README.md +17 -17
- package/examples/form-renderer/cli.ts +32 -32
- package/examples/form-renderer/index.ts +144 -144
- package/examples/form-renderer/package.json +16 -16
- package/examples/form-renderer/tsconfig.json +14 -14
- package/examples/llm-chat/README.md +38 -38
- package/examples/llm-chat/index.ts +100 -100
- package/examples/llm-chat/package.json +19 -19
- package/examples/llm-chat/tsconfig.json +14 -14
- package/examples/minimal-node/README.md +31 -31
- package/examples/minimal-node/index.ts +138 -138
- package/examples/minimal-node/package.json +17 -17
- package/examples/minimal-node/tsconfig.json +14 -14
- package/package.json +259 -258
- package/dist/catalog/grsai/gptImage25Sizes.d.ts +0 -1
- package/dist/catalog/grsai/gptImage25Sizes.js +0 -76
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.d.ts +0 -2
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.js +0 -29
- package/dist/catalog/modelscope/qwen-image-edit-2509.model.d.ts +0 -5
- package/dist/catalog/modelscope/qwen-image.model.d.ts +0 -5
- package/dist/catalog/ppio/minimax-hailuo-2.3.model.d.ts +0 -7
- package/dist/catalog/ppio/minimax-hailuo-2.3.model.js +0 -114
- package/dist/catalog/ppio/wan-2.5-preview.model.d.ts +0 -7
- package/dist/catalog/ppio/wan-2.5-preview.model.js +0 -198
- package/dist/catalog/ppio/wan-2.6.model.d.ts +0 -7
- package/dist/catalog/ppio/wan-2.6.model.js +0 -206
- package/dist/catalog/ppio/wan-2.7.model.d.ts +0 -2
- package/dist/catalog/ppio/wan-2.7.model.js +0 -373
- package/docs/model-adaptation/Hailuo-2.3/Hailuo-2.3_/346/264/276/346/254/247/344/272/221.md +0 -70
- package/docs/model-adaptation/TeleSpeechASR/TeleSpeechASR_/347/241/205/345/237/272/346/265/201/345/212/250.md +0 -76
- package/docs/model-adaptation/Wan-2.5-Preview/Wan-2.5-Preview_/346/264/276/346/254/247/344/272/221.md +0 -82
- package/docs/model-adaptation/Wan-2.6/Wan-2.6_/346/264/276/346/254/247/344/272/221.md +0 -84
- package/docs/model-adaptation/Wan-2.7/Wan-2.7_/346/264/276/346/254/247/344/272/221.md +0 -122
- /package/dist/upload/{fal-legacy.d.ts → fal-host-fetch.d.ts} +0 -0
|
@@ -81,14 +81,12 @@ async function executeFunShort(preset, input, apiKey, apiBaseUrl, context) {
|
|
|
81
81
|
const parameters = { format: formatFrom(input, options) };
|
|
82
82
|
if (options.sampleRateHz !== undefined)
|
|
83
83
|
parameters.sample_rate = String(options.sampleRateHz);
|
|
84
|
-
if (preset.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
parameters.vocabulary = options.vocabulary;
|
|
91
|
-
}
|
|
84
|
+
if (preset.supports?.keepDialect && options.keepDialect !== undefined)
|
|
85
|
+
parameters.keep_dialect = options.keepDialect;
|
|
86
|
+
if (preset.supports?.speakerDiarization && options.diarizationEnabled !== undefined)
|
|
87
|
+
parameters.speaker_diarization_enabled = options.diarizationEnabled;
|
|
88
|
+
if (preset.supports?.vocabulary && options.vocabulary !== undefined)
|
|
89
|
+
parameters.vocabulary = options.vocabulary;
|
|
92
90
|
if (options.vocabularyId)
|
|
93
91
|
parameters.vocabulary_id = options.vocabularyId;
|
|
94
92
|
const languageHints = [...new Set([...(input.hints ?? []), ...(input.language ? [input.language] : [])]
|
|
@@ -151,10 +149,8 @@ function asyncParameters(preset, input, options) {
|
|
|
151
149
|
...(options.speakerCount !== undefined ? { speaker_count: options.speakerCount } : {}),
|
|
152
150
|
...(options.channelId !== undefined ? { channel_id: [options.channelId] } : {}),
|
|
153
151
|
...(options.specialWordFilter ? { special_word_filter: options.specialWordFilter } : {}),
|
|
154
|
-
...(preset.
|
|
155
|
-
|
|
156
|
-
...(options.vocabulary !== undefined ? { vocabulary: options.vocabulary } : {}),
|
|
157
|
-
} : {}),
|
|
152
|
+
...(preset.supports?.keepDialect && options.keepDialect !== undefined ? { keep_dialect: options.keepDialect } : {}),
|
|
153
|
+
...(preset.supports?.vocabulary && options.vocabulary !== undefined ? { vocabulary: options.vocabulary } : {}),
|
|
158
154
|
};
|
|
159
155
|
}
|
|
160
156
|
async function wait(ms, context) {
|
|
@@ -172,19 +168,35 @@ async function wait(ms, context) {
|
|
|
172
168
|
});
|
|
173
169
|
}
|
|
174
170
|
async function executeFile(preset, input, apiKey, apiBaseUrl, uploadBaseUrl, config, context) {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
171
|
+
const resumeTaskId = providerOptions(input).resumeTaskId;
|
|
172
|
+
let submitted;
|
|
173
|
+
if (resumeTaskId !== undefined) {
|
|
174
|
+
if (typeof resumeTaskId !== 'string' || !/^[a-zA-Z0-9_-]{1,256}$/.test(resumeTaskId))
|
|
175
|
+
throw new AiRuntimeError('invalid_parameter', 'Invalid ASR resume task ID');
|
|
176
|
+
const response = await context.runtime.transport.fetch(`${apiBaseUrl}/tasks/${encodeURIComponent(resumeTaskId)}`, { headers: { Authorization: `Bearer ${apiKey}` }, signal: context.signal });
|
|
177
|
+
submitted = parseTaskState(await responseJson(response, 'file ASR resume'));
|
|
178
|
+
if (submitted.taskId && submitted.taskId !== resumeTaskId)
|
|
179
|
+
throw new AiRuntimeError('invalid_response', 'ASR resume returned a different task');
|
|
180
|
+
submitted = { ...submitted, taskId: resumeTaskId };
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
const audio = await resolveAsyncAudioUrl(input.audio, preset.modelId, apiKey, uploadBaseUrl, context).catch((error) => {
|
|
184
|
+
// Upload/policy failures precede paid ASR submission. Do not infer this for submit/poll failures.
|
|
185
|
+
throw new AiRuntimeError(error instanceof AiRuntimeError ? error.code : 'audio_upload_failed', error instanceof AiRuntimeError ? error.message.replace(`[${error.code}] `, '') : error instanceof Error ? error.message : String(error), { ...(error instanceof AiRuntimeError ? error.details : {}), retryable: false, billing: 'not_charged', execution: { notExecuted: true } });
|
|
186
|
+
});
|
|
187
|
+
const asyncInput = preset.asyncInputField === 'file_urls' ? { file_urls: [audio.url] } : { file_url: audio.url };
|
|
188
|
+
const headers = {
|
|
189
|
+
Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'X-DashScope-Async': 'enable',
|
|
190
|
+
};
|
|
191
|
+
if (audio.usesOss)
|
|
192
|
+
headers['X-DashScope-OssResourceResolve'] = 'enable';
|
|
193
|
+
const submitResponse = await context.runtime.transport.fetch(`${apiBaseUrl}/services/audio/asr/transcription`, {
|
|
194
|
+
method: 'POST', headers,
|
|
195
|
+
body: JSON.stringify({ model: preset.modelId, input: asyncInput, parameters: asyncParameters(preset, input, providerOptions(input)) }),
|
|
196
|
+
signal: context.signal,
|
|
197
|
+
});
|
|
198
|
+
submitted = parseTaskState(await responseJson(submitResponse, 'file ASR submit'));
|
|
199
|
+
}
|
|
188
200
|
const taskId = submitted.taskId;
|
|
189
201
|
if (!taskId)
|
|
190
202
|
throw new AiRuntimeError('invalid_response', 'Bailian file ASR submit response has no task_id');
|
|
@@ -223,9 +235,11 @@ export function createBailianAsrModule(preset, options = {}) {
|
|
|
223
235
|
maxPollingMs: options.maxPollingMs ?? 30 * 60_000,
|
|
224
236
|
};
|
|
225
237
|
return {
|
|
226
|
-
descriptor: preset.descriptor,
|
|
238
|
+
descriptor: preset.protocol === 'fun-short-sse' || preset.protocol === 'qwen-short' ? preset.descriptor : { ...preset.descriptor, features: [...preset.descriptor.features ?? [], 'resume-task'] },
|
|
227
239
|
execute: async (input, context) => {
|
|
228
240
|
checkAbort(context);
|
|
241
|
+
if (providerOptions(input).resumeTaskId !== undefined && (preset.protocol === 'fun-short-sse' || preset.protocol === 'qwen-short'))
|
|
242
|
+
throw new AiRuntimeError('unsupported_operation', 'Short ASR cannot resume a file task');
|
|
229
243
|
const apiKey = await credential(context);
|
|
230
244
|
if (preset.protocol === 'fun-short-sse') {
|
|
231
245
|
return await executeFunShort(preset, input, apiKey, apiBaseUrl, context);
|
|
@@ -56,6 +56,7 @@ export function parseFunShortSse(payload) {
|
|
|
56
56
|
const segments = [];
|
|
57
57
|
let latestText = '';
|
|
58
58
|
let durationMs;
|
|
59
|
+
let usage;
|
|
59
60
|
for (const line of payload.split(/\r?\n/)) {
|
|
60
61
|
const trimmed = line.trim();
|
|
61
62
|
if (!trimmed.startsWith('data:'))
|
|
@@ -75,9 +76,15 @@ export function parseFunShortSse(payload) {
|
|
|
75
76
|
throw new AiRuntimeError('provider_task_failed', text(root?.message) ?? String(root?.code));
|
|
76
77
|
const output = record(root?.output);
|
|
77
78
|
latestText = text(output?.text) ?? latestText;
|
|
78
|
-
const
|
|
79
|
+
const usageRecord = record(root?.usage);
|
|
80
|
+
const durationSeconds = numberValue(usageRecord?.duration);
|
|
79
81
|
if (durationSeconds !== undefined)
|
|
80
82
|
durationMs = durationSeconds * 1_000;
|
|
83
|
+
// 只有 qwen-audio-3.1-asr-flash 返回 token 用量(按 token 计费);随句末结果给出,以最后一次为准。
|
|
84
|
+
const inputTokens = numberValue(usageRecord?.input_tokens);
|
|
85
|
+
const outputTokens = numberValue(usageRecord?.output_tokens);
|
|
86
|
+
if (inputTokens !== undefined || outputTokens !== undefined)
|
|
87
|
+
usage = { inputTokens, outputTokens };
|
|
81
88
|
for (const sentence of recordsOrOne(output?.sentences ?? output?.sentence)) {
|
|
82
89
|
if (sentence.sentence_end !== true)
|
|
83
90
|
continue;
|
|
@@ -103,7 +110,7 @@ export function parseFunShortSse(payload) {
|
|
|
103
110
|
const finalText = combined || latestText;
|
|
104
111
|
if (!finalText)
|
|
105
112
|
throw new AiRuntimeError('invalid_response', 'Bailian Fun-ASR response has no transcript');
|
|
106
|
-
return { text: finalText, durationMs, segments, providerMetadata: { protocol: 'fun-short-sse' } };
|
|
113
|
+
return { text: finalText, durationMs, segments, ...(usage ? { usage } : {}), providerMetadata: { protocol: 'fun-short-sse' } };
|
|
107
114
|
}
|
|
108
115
|
export function parseQwenShortResponse(payload) {
|
|
109
116
|
const root = record(payload);
|
|
@@ -8,6 +8,12 @@ export interface BailianAsrPreset {
|
|
|
8
8
|
/** Data URI 路径的原始音频上限;更大文件应走远端 URL 或异步文件转写。 */
|
|
9
9
|
maxInlineBytes?: number;
|
|
10
10
|
asyncInputField?: 'file_urls' | 'file_url';
|
|
11
|
+
/** Qwen-Audio-ASR 接口里按模型开放的参数:即时热词 vocabulary、方言保留 keep_dialect、短音频说话人分离。 */
|
|
12
|
+
supports?: {
|
|
13
|
+
vocabulary?: true;
|
|
14
|
+
keepDialect?: true;
|
|
15
|
+
speakerDiarization?: true;
|
|
16
|
+
};
|
|
11
17
|
}
|
|
12
18
|
export declare const bailianFunAsrFlash20260615: BailianAsrPreset;
|
|
13
19
|
export declare const bailianQwen3AsrFlash: BailianAsrPreset;
|
|
@@ -16,4 +22,6 @@ export declare const bailianFunAsr: BailianAsrPreset;
|
|
|
16
22
|
export declare const bailianQwen3AsrFlashFiletrans: BailianAsrPreset;
|
|
17
23
|
export declare const bailianQwenAudio31AsrFlash: BailianAsrPreset;
|
|
18
24
|
export declare const bailianQwenAudio31AsrFlashFiletrans: BailianAsrPreset;
|
|
19
|
-
export declare const
|
|
25
|
+
export declare const bailianQwenAudio30AsrFlash: BailianAsrPreset;
|
|
26
|
+
export declare const bailianQwenAudio30AsrFlashFiletrans: BailianAsrPreset;
|
|
27
|
+
export declare const bailianNonRealtimeAsrPresets: readonly [BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset, BailianAsrPreset];
|
|
@@ -46,8 +46,11 @@ export const bailianQwen3AsrFlashFiletrans = definePreset({
|
|
|
46
46
|
protocol: 'file-async',
|
|
47
47
|
asyncInputField: 'file_url',
|
|
48
48
|
});
|
|
49
|
-
export const bailianQwenAudio31AsrFlash = definePreset({ modelId: 'qwen-audio-3.1-asr-flash', protocol: 'fun-short-sse', maxInlineBytes: 7_500_000 });
|
|
50
|
-
export const bailianQwenAudio31AsrFlashFiletrans = definePreset({ modelId: 'qwen-audio-3.1-asr-flash-filetrans', protocol: 'file-async', asyncInputField: 'file_urls' });
|
|
49
|
+
export const bailianQwenAudio31AsrFlash = definePreset({ modelId: 'qwen-audio-3.1-asr-flash', protocol: 'fun-short-sse', maxInlineBytes: 7_500_000, supports: { vocabulary: true, keepDialect: true, speakerDiarization: true } });
|
|
50
|
+
export const bailianQwenAudio31AsrFlashFiletrans = definePreset({ modelId: 'qwen-audio-3.1-asr-flash-filetrans', protocol: 'file-async', asyncInputField: 'file_urls', supports: { vocabulary: true, keepDialect: true } });
|
|
51
|
+
// 3.0 与 3.1 是同一套 Qwen-Audio-ASR 接口;3.0 按音频秒数计费,3.1 按 token 计费。官方标注方言保留与短音频说话人分离仅 3.1 支持。
|
|
52
|
+
export const bailianQwenAudio30AsrFlash = definePreset({ modelId: 'qwen-audio-3.0-asr-flash', protocol: 'fun-short-sse', maxInlineBytes: 7_500_000, supports: { vocabulary: true } });
|
|
53
|
+
export const bailianQwenAudio30AsrFlashFiletrans = definePreset({ modelId: 'qwen-audio-3.0-asr-flash-filetrans', protocol: 'file-async', asyncInputField: 'file_urls', supports: { vocabulary: true } });
|
|
51
54
|
export const bailianNonRealtimeAsrPresets = [
|
|
52
55
|
bailianFunAsrFlash20260615,
|
|
53
56
|
bailianQwen3AsrFlash,
|
|
@@ -56,4 +59,6 @@ export const bailianNonRealtimeAsrPresets = [
|
|
|
56
59
|
bailianQwen3AsrFlashFiletrans,
|
|
57
60
|
bailianQwenAudio31AsrFlash,
|
|
58
61
|
bailianQwenAudio31AsrFlashFiletrans,
|
|
62
|
+
bailianQwenAudio30AsrFlash,
|
|
63
|
+
bailianQwenAudio30AsrFlashFiletrans,
|
|
59
64
|
];
|
|
@@ -11,4 +11,5 @@ export declare const bailianFunAsrRealtime20260228: BailianRealtimeAsrPreset;
|
|
|
11
11
|
export declare const bailianQwen3AsrFlashRealtime: BailianRealtimeAsrPreset;
|
|
12
12
|
export declare const bailianQwen3AsrFlashRealtime20260210: BailianRealtimeAsrPreset;
|
|
13
13
|
export declare const bailianQwenAudio31AsrFlashStreaming: BailianRealtimeAsrPreset;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const bailianQwenAudio30AsrFlashStreaming: BailianRealtimeAsrPreset;
|
|
15
|
+
export declare const bailianRealtimeAsrPresets: readonly [BailianRealtimeAsrPreset, BailianRealtimeAsrPreset, BailianRealtimeAsrPreset, BailianRealtimeAsrPreset, BailianRealtimeAsrPreset, BailianRealtimeAsrPreset];
|
|
@@ -25,10 +25,12 @@ export const bailianFunAsrRealtime20260228 = definePreset('fun-asr-realtime-2026
|
|
|
25
25
|
export const bailianQwen3AsrFlashRealtime = definePreset('qwen3-asr-flash-realtime', 'qwen-realtime');
|
|
26
26
|
export const bailianQwen3AsrFlashRealtime20260210 = definePreset('qwen3-asr-flash-realtime-2026-02-10', 'qwen-realtime');
|
|
27
27
|
export const bailianQwenAudio31AsrFlashStreaming = definePreset('qwen-audio-3.1-asr-flash-streaming', 'fun-duplex');
|
|
28
|
+
export const bailianQwenAudio30AsrFlashStreaming = definePreset('qwen-audio-3.0-asr-flash-streaming', 'fun-duplex');
|
|
28
29
|
export const bailianRealtimeAsrPresets = [
|
|
29
30
|
bailianFunAsrRealtime,
|
|
30
31
|
bailianFunAsrRealtime20260228,
|
|
31
32
|
bailianQwen3AsrFlashRealtime,
|
|
32
33
|
bailianQwen3AsrFlashRealtime20260210,
|
|
33
34
|
bailianQwenAudio31AsrFlashStreaming,
|
|
35
|
+
bailianQwenAudio30AsrFlashStreaming,
|
|
34
36
|
];
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
import { readCapabilityMediaSource } from '../../media.js';
|
|
2
2
|
import { assertMediaSize, rethrowMediaError } from '../../../runtime/MediaReader.js';
|
|
3
3
|
import { AiRuntimeError } from '../../../runtime/AiRuntimeError.js';
|
|
4
|
-
|
|
5
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
6
|
-
? value
|
|
7
|
-
: undefined;
|
|
8
|
-
}
|
|
9
|
-
function requiredString(record, key) {
|
|
10
|
-
const value = record?.[key];
|
|
11
|
-
if (typeof value !== 'string' || !value) {
|
|
12
|
-
throw new AiRuntimeError('invalid_response', `Bailian upload policy has no ${key}`);
|
|
13
|
-
}
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
async function json(response, operation) {
|
|
17
|
-
const body = await response.text();
|
|
18
|
-
if (!response.ok) {
|
|
19
|
-
throw new AiRuntimeError('provider_http_error', `Bailian ${operation} failed with HTTP ${response.status}`);
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
return JSON.parse(body);
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
throw new AiRuntimeError('invalid_response', `Bailian ${operation} returned invalid JSON`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
4
|
+
import { requestBailianUploadTarget } from '../../../upload/bailian-oss-upload.js';
|
|
28
5
|
export async function resolveAsyncAudioUrl(source, modelId, apiKey, apiBaseUrl, context) {
|
|
29
6
|
if (source.kind === 'remote-url') {
|
|
30
7
|
const value = source.url.trim();
|
|
@@ -43,45 +20,21 @@ export async function resolveAsyncAudioUrl(source, modelId, apiKey, apiBaseUrl,
|
|
|
43
20
|
return { url: parsed.toString(), usesOss: false };
|
|
44
21
|
}
|
|
45
22
|
if (source.kind === 'media-ref' && !context.runtime.transport.uploadFile) {
|
|
46
|
-
throw new AiRuntimeError('native_upload_unsupported', '
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const policyPayload = asRecord(await json(policyResponse, 'upload policy'));
|
|
50
|
-
const policy = asRecord(policyPayload?.data);
|
|
51
|
-
const uploadHost = requiredString(policy, 'upload_host');
|
|
52
|
-
let host;
|
|
53
|
-
try {
|
|
54
|
-
host = new URL(uploadHost);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
throw new AiRuntimeError('invalid_response', 'Bailian upload_host is invalid');
|
|
58
|
-
}
|
|
59
|
-
if (host.protocol !== 'https:')
|
|
60
|
-
throw new AiRuntimeError('invalid_response', 'Bailian upload_host must use HTTPS');
|
|
61
|
-
const uploadDir = requiredString(policy, 'upload_dir').replace(/^\/+|\/+$/g, '');
|
|
62
|
-
const rawLimit = policy?.max_file_size_mb;
|
|
63
|
-
const maxFileSizeMb = typeof rawLimit === 'number' || typeof rawLimit === 'string' ? Number(rawLimit) : NaN;
|
|
64
|
-
if (!Number.isFinite(maxFileSizeMb) || maxFileSizeMb <= 0) {
|
|
65
|
-
throw new AiRuntimeError('invalid_response', 'Bailian upload policy has invalid max_file_size_mb');
|
|
23
|
+
throw new AiRuntimeError('native_upload_unsupported', '宿主未提供本地文件直传;请升级宿主适配器', {
|
|
24
|
+
retryable: false, billing: 'not_charged', execution: { notExecuted: true },
|
|
25
|
+
});
|
|
66
26
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
form.append('OSSAccessKeyId', requiredString(policy, 'oss_access_key_id'));
|
|
73
|
-
form.append('Signature', requiredString(policy, 'signature'));
|
|
74
|
-
form.append('policy', requiredString(policy, 'policy'));
|
|
75
|
-
form.append('x-oss-object-acl', requiredString(policy, 'x_oss_object_acl'));
|
|
76
|
-
form.append('x-oss-forbid-overwrite', requiredString(policy, 'x_oss_forbid_overwrite'));
|
|
77
|
-
form.append('key', objectKey);
|
|
78
|
-
form.append('success_action_status', '200');
|
|
27
|
+
const target = await requestBailianUploadTarget({
|
|
28
|
+
transport: context.runtime.transport, apiKey, modelId, apiBaseUrl,
|
|
29
|
+
objectName: `${context.requestId}-${Date.now()}-audio`, signal: context.signal,
|
|
30
|
+
});
|
|
31
|
+
const { fields, maxBytes, objectKey } = target;
|
|
79
32
|
context.runtime.logger.info('百炼音频上传开始', {
|
|
80
33
|
event: 'capability.bailian_asr.upload.start', requestId: context.requestId, providerId: 'bailian', modelId,
|
|
81
34
|
});
|
|
82
35
|
let uploadResponse;
|
|
83
36
|
if (source.kind === 'media-ref') {
|
|
84
|
-
uploadResponse = await context.runtime.transport.uploadFile(
|
|
37
|
+
uploadResponse = await context.runtime.transport.uploadFile(target.uploadUrl, {
|
|
85
38
|
ref: source.ref, fields, fileField: 'file', maxBytes, signal: context.signal,
|
|
86
39
|
}).catch(rethrowMediaError);
|
|
87
40
|
}
|
|
@@ -92,7 +45,7 @@ export async function resolveAsyncAudioUrl(source, modelId, apiKey, apiBaseUrl,
|
|
|
92
45
|
for (const [key, value] of fields)
|
|
93
46
|
multipart.append(key, value);
|
|
94
47
|
multipart.append('file', new Blob([new Uint8Array(media.bytes)], { type: media.mimeType }), media.filename);
|
|
95
|
-
uploadResponse = await context.runtime.transport.fetch(
|
|
48
|
+
uploadResponse = await context.runtime.transport.fetch(target.uploadUrl, {
|
|
96
49
|
method: 'POST', body: multipart, signal: context.signal,
|
|
97
50
|
});
|
|
98
51
|
}
|
|
@@ -28,6 +28,11 @@ export interface SpeechRecognitionOutput {
|
|
|
28
28
|
language?: string;
|
|
29
29
|
durationMs?: number;
|
|
30
30
|
segments?: readonly SpeechRecognitionSegment[];
|
|
31
|
+
/** 按 token 计费的模型返回的用量;按音频时长计费的模型不返回。 */
|
|
32
|
+
usage?: {
|
|
33
|
+
inputTokens?: number;
|
|
34
|
+
outputTokens?: number;
|
|
35
|
+
};
|
|
31
36
|
providerMetadata?: unknown;
|
|
32
37
|
}
|
|
33
38
|
export type SpeechRecognitionEvent = {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { defineSpeechRecognitionDescriptor } from '../index.js';
|
|
2
2
|
export interface SiliconFlowAsrPreset {
|
|
3
3
|
id: string;
|
|
4
|
-
modelId: 'FunAudioLLM/SenseVoiceSmall'
|
|
4
|
+
modelId: 'FunAudioLLM/SenseVoiceSmall';
|
|
5
5
|
descriptor: ReturnType<typeof defineSpeechRecognitionDescriptor>;
|
|
6
6
|
}
|
|
7
7
|
export declare const siliconFlowSenseVoiceSmall: SiliconFlowAsrPreset;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const siliconFlowAsrPresets: readonly [SiliconFlowAsrPreset, SiliconFlowAsrPreset];
|
|
8
|
+
export declare const siliconFlowAsrPresets: readonly [SiliconFlowAsrPreset];
|
|
@@ -16,8 +16,6 @@ function definePreset(modelId) {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export const siliconFlowSenseVoiceSmall = definePreset('FunAudioLLM/SenseVoiceSmall');
|
|
19
|
-
export const siliconFlowTeleSpeechAsr = definePreset('TeleAI/TeleSpeechASR');
|
|
20
19
|
export const siliconFlowAsrPresets = [
|
|
21
20
|
siliconFlowSenseVoiceSmall,
|
|
22
|
-
siliconFlowTeleSpeechAsr,
|
|
23
21
|
];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type TokenListPricing } from '../../../pricing/tokenPricing.js';
|
|
1
2
|
export type BailianQwenMtModelId = 'qwen-mt-flash' | 'qwen-mt-plus' | 'qwen-mt-lite';
|
|
2
3
|
export type BailianQwenMtStreamingContent = 'incremental' | 'cumulative';
|
|
3
4
|
export interface BailianQwenMtPreset {
|
|
4
5
|
moduleId: string;
|
|
5
6
|
modelId: BailianQwenMtModelId;
|
|
6
7
|
streamingContent: BailianQwenMtStreamingContent;
|
|
8
|
+
/** 华北2(北京)原价,不含限时免费额度。 */
|
|
9
|
+
pricing: TokenListPricing;
|
|
7
10
|
}
|
|
8
11
|
export declare const BAILIAN_QWEN_MT_PRESETS: {
|
|
9
12
|
readonly flash: BailianQwenMtPreset;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { tokenListPrice } from '../../../pricing/tokenPricing.js';
|
|
2
|
+
function defineQwenMtPreset(modelId, streamingContent, pricing) {
|
|
2
3
|
return {
|
|
3
4
|
moduleId: `bailian.translation.${modelId}`,
|
|
4
5
|
modelId,
|
|
5
6
|
streamingContent,
|
|
7
|
+
pricing,
|
|
6
8
|
};
|
|
7
9
|
}
|
|
8
10
|
export const BAILIAN_QWEN_MT_PRESETS = {
|
|
9
|
-
flash: defineQwenMtPreset('qwen-mt-flash', 'incremental'),
|
|
10
|
-
plus: defineQwenMtPreset('qwen-mt-plus', 'cumulative'),
|
|
11
|
-
lite: defineQwenMtPreset('qwen-mt-lite', 'incremental'),
|
|
11
|
+
flash: defineQwenMtPreset('qwen-mt-flash', 'incremental', tokenListPrice('CNY', 0.7, 1.95)),
|
|
12
|
+
plus: defineQwenMtPreset('qwen-mt-plus', 'cumulative', tokenListPrice('CNY', 1.8, 5.4)),
|
|
13
|
+
lite: defineQwenMtPreset('qwen-mt-lite', 'incremental', tokenListPrice('CNY', 0.6, 1.6)),
|
|
12
14
|
};
|
|
13
15
|
export const DEFAULT_BAILIAN_QWEN_MT_ENDPOINT = 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** APIMart FLUX 3 Image 与 FLUX 3 Image Klein 统一模型(运行时契约) */
|
|
2
|
+
import { defineModel } from '../defineModel.js';
|
|
3
|
+
import { hasUploadedImage, resolveUploadedImageSources } from '../shared/mediaPresence.js';
|
|
4
|
+
const RATIOS = ['21:9', '2:1', '16:9', '3:2', '7:5', '4:3', '5:4', '1:1', '4:5', '3:4', '5:7', '2:3', '9:16', '1:2', '9:21'];
|
|
5
|
+
const RESOLUTIONS = ['768sq', '1k', '1.5k', '2k', '4k'];
|
|
6
|
+
const PRICES = {
|
|
7
|
+
standard: { '768sq': 0.0328, '1k': 0.0384, '1.5k': 0.056, '2k': 0.08, '4k': 0.4856 },
|
|
8
|
+
klein: { '768sq': 0.0064, '1k': 0.0072, '1.5k': 0.0088, '2k': 0.0112, '4k': 0.0288 },
|
|
9
|
+
};
|
|
10
|
+
function resolution(params) {
|
|
11
|
+
return RESOLUTIONS.includes(String(params.apimartFlux3Resolution)) ? String(params.apimartFlux3Resolution) : '1k';
|
|
12
|
+
}
|
|
13
|
+
function ratio(params) {
|
|
14
|
+
const raw = String(params.apimartFlux3AspectRatio || 'smart');
|
|
15
|
+
if (RATIOS.includes(raw))
|
|
16
|
+
return raw;
|
|
17
|
+
const hint = hasUploadedImage(params) && typeof params.__firstImageRatio === 'number'
|
|
18
|
+
&& Number.isFinite(params.__firstImageRatio) && params.__firstImageRatio > 0 ? params.__firstImageRatio : 1;
|
|
19
|
+
const numeric = (value) => { const [w, h] = value.split(':').map(Number); return w / h; };
|
|
20
|
+
return RATIOS.reduce((best, next) => Math.abs(numeric(next) - hint) < Math.abs(numeric(best) - hint) ? next : best, '1:1');
|
|
21
|
+
}
|
|
22
|
+
export const apimartFlux3ImageModel = defineModel({
|
|
23
|
+
meta: {
|
|
24
|
+
id: 'apimart-flux-3-image', canonicalModelId: 'flux-3', seriesId: 'flux', seriesRank: 3,
|
|
25
|
+
provider: 'apimart', type: 'image',
|
|
26
|
+
tags: ['text-to-image', 'image-to-image'],
|
|
27
|
+
polling: { interval: 3000, maxAttempts: 200, expectedAttempts: 30 },
|
|
28
|
+
},
|
|
29
|
+
inputLimits: { images: { max: 10 }, videos: { max: 0 } },
|
|
30
|
+
params: [
|
|
31
|
+
{ id: 'apimartFlux3Variant', type: 'dropdown', order: 1, default: 'standard', options: [{ value: 'standard' }, { value: 'klein' }] },
|
|
32
|
+
{ id: 'apimartFlux3AspectRatio', type: 'dropdown', order: 2, default: 'smart', options: [{ value: 'smart' }, ...RATIOS.map(value => ({ value }))] },
|
|
33
|
+
{ id: 'apimartFlux3Resolution', type: 'dropdown', order: 3, default: '1k', options: RESOLUTIONS.map(value => ({ value })) },
|
|
34
|
+
],
|
|
35
|
+
endpoints: '/v1/images/generations',
|
|
36
|
+
request: {
|
|
37
|
+
builder: (params) => {
|
|
38
|
+
const prompt = typeof params.prompt === 'string' ? params.prompt.trim() : '';
|
|
39
|
+
if (!prompt)
|
|
40
|
+
throw new Error('请输入 FLUX 3 Image 提示词');
|
|
41
|
+
const images = resolveUploadedImageSources(params);
|
|
42
|
+
if (images.length > 10)
|
|
43
|
+
throw new Error('FLUX 3 Image 最多支持 10 张参考图');
|
|
44
|
+
const body = {
|
|
45
|
+
model: params.apimartFlux3Variant === 'klein' ? 'flux-3-image-klein' : 'flux-3-image',
|
|
46
|
+
prompt,
|
|
47
|
+
aspect_ratio: ratio(params),
|
|
48
|
+
resolution: resolution(params),
|
|
49
|
+
n: 1,
|
|
50
|
+
};
|
|
51
|
+
if (images.length > 0)
|
|
52
|
+
body.image_urls = images;
|
|
53
|
+
return body;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
pricing: {
|
|
57
|
+
currency: '$',
|
|
58
|
+
calculator: (params) => PRICES[params.apimartFlux3Variant === 'klein' ? 'klein' : 'standard'][resolution(params)],
|
|
59
|
+
description: 'FLUX 3 Image 每张 768sq $0.0328、1k $0.0384、1.5k $0.056、2k $0.08、4k $0.4856;Klein 每张 768sq $0.0064、1k $0.0072、1.5k $0.0088、2k $0.0112、4k $0.0288;参考图不另收费',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
export default apimartFlux3ImageModel;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** APIMart FLUX 3 Video 统一模型(运行时契约) */
|
|
2
|
+
import { readContinuation } from '../continuation.js';
|
|
3
|
+
import { defineModel } from '../defineModel.js';
|
|
4
|
+
import { hasUploadedImage, resolveUploadedImageSources, resolveUploadedVideoSources } from '../shared/mediaPresence.js';
|
|
5
|
+
// 字段、限制与价格来源:docs/model-adaptation/FLUX-3-Video/FLUX-3-Video_APIMart.md(2026-11-07 读取)。
|
|
6
|
+
const RATIOS = ['21:9', '2:1', '16:9', '4:3', '1:1', '3:4', '9:16'];
|
|
7
|
+
const RATES = {
|
|
8
|
+
generate: { hd: 0.136, fhd: 0.232 },
|
|
9
|
+
extend: { hd: 0.328, fhd: 0.424 },
|
|
10
|
+
};
|
|
11
|
+
// 草稿只出 hd,单价不分档。
|
|
12
|
+
const DRAFT_RATES = { generate: 0.048, extend: 0.096 };
|
|
13
|
+
const FINALIZE_DRAFT = 'finalize-draft';
|
|
14
|
+
function isExtend(params) {
|
|
15
|
+
return params.apimartFlux3VideoMode === 'extend';
|
|
16
|
+
}
|
|
17
|
+
function isDraft(params) {
|
|
18
|
+
return params.apimartFlux3VideoDraft === true;
|
|
19
|
+
}
|
|
20
|
+
function resolution(params) {
|
|
21
|
+
return params.apimartFlux3VideoResolution === 'fhd' ? 'fhd' : 'hd';
|
|
22
|
+
}
|
|
23
|
+
function duration(params) {
|
|
24
|
+
const value = Number(params.apimartFlux3VideoDuration ?? 5);
|
|
25
|
+
return Number.isFinite(value) ? Math.min(20, Math.max(5, Math.round(value))) : 5;
|
|
26
|
+
}
|
|
27
|
+
function draftTaskId(params) {
|
|
28
|
+
const taskId = readContinuation(params, FINALIZE_DRAFT)?.reference.taskId;
|
|
29
|
+
return typeof taskId === 'string' && taskId.trim() ? taskId.trim() : null;
|
|
30
|
+
}
|
|
31
|
+
export const apimartFlux3VideoModel = defineModel({
|
|
32
|
+
meta: {
|
|
33
|
+
id: 'apimart-flux-3-video', canonicalModelId: 'flux-3-video', seriesId: 'flux', seriesRank: 3,
|
|
34
|
+
provider: 'apimart', type: 'video',
|
|
35
|
+
tags: ['text-to-video', 'image-to-video', 'start-end-frame', 'video-extension'],
|
|
36
|
+
polling: { interval: 5000, maxAttempts: 180, expectedAttempts: 12 },
|
|
37
|
+
},
|
|
38
|
+
// 转正片只认草稿任务,不收素材;续写模式的“需要 1 段视频”在转正片时不适用。
|
|
39
|
+
inputLimits: (params) => readContinuation(params, FINALIZE_DRAFT)
|
|
40
|
+
? { images: { max: 0 }, videos: { max: 0 } }
|
|
41
|
+
: params.apimartFlux3VideoMode === 'extend'
|
|
42
|
+
? { images: { max: 0 }, videos: { exact: 1 } }
|
|
43
|
+
: { images: { max: 10 }, videos: { max: 0 } },
|
|
44
|
+
params: [
|
|
45
|
+
{ id: 'apimartFlux3VideoMode', type: 'dropdown', order: 1, default: 'text-image-to-video', options: [{ value: 'text-image-to-video' }, { value: 'extend' }] },
|
|
46
|
+
{
|
|
47
|
+
id: 'apimartFlux3VideoAspectRatio', type: 'dropdown', order: 2, default: 'smart',
|
|
48
|
+
visible: { condition: (params) => !isExtend(params) && !hasUploadedImage(params) },
|
|
49
|
+
options: [{ value: 'smart' }, ...RATIOS.map(value => ({ value }))],
|
|
50
|
+
},
|
|
51
|
+
// 草稿固定 hd;开草稿时这里是转正片时的分辨率,转正片只允许改它。
|
|
52
|
+
{ id: 'apimartFlux3VideoResolution', type: 'dropdown', order: 3, default: 'hd', options: [{ value: 'hd' }, { value: 'fhd' }] },
|
|
53
|
+
{ id: 'apimartFlux3VideoDuration', type: 'number', order: 4, default: 5, min: 5, max: 20, step: 1 },
|
|
54
|
+
{ id: 'apimartFlux3VideoAudio', type: 'switch', order: 5, default: true },
|
|
55
|
+
{ id: 'apimartFlux3VideoDraft', type: 'switch', order: 6, default: false },
|
|
56
|
+
],
|
|
57
|
+
continuations: [{
|
|
58
|
+
id: FINALIZE_DRAFT,
|
|
59
|
+
available: isDraft,
|
|
60
|
+
capture: ({ taskId }) => taskId ? { taskId } : null,
|
|
61
|
+
params: source => ({ ...source, apimartFlux3VideoDraft: false }),
|
|
62
|
+
submit: 'direct',
|
|
63
|
+
}],
|
|
64
|
+
endpoints: '/v1/videos/generations',
|
|
65
|
+
request: {
|
|
66
|
+
builder: (params) => {
|
|
67
|
+
// 转正片沿用草稿保存的模式、提示词、时长与素材,官方只允许再改分辨率,传 prompt 会被拒绝。
|
|
68
|
+
const fromDraft = draftTaskId(params);
|
|
69
|
+
if (fromDraft)
|
|
70
|
+
return { model: 'flux-3-video', draft_from_task_id: fromDraft, resolution: resolution(params) };
|
|
71
|
+
const prompt = typeof params.prompt === 'string' ? params.prompt.trim() : '';
|
|
72
|
+
if (!prompt)
|
|
73
|
+
throw new Error('请输入 FLUX 3 Video 提示词');
|
|
74
|
+
const images = resolveUploadedImageSources(params);
|
|
75
|
+
const videos = resolveUploadedVideoSources(params);
|
|
76
|
+
const body = {
|
|
77
|
+
model: 'flux-3-video',
|
|
78
|
+
prompt,
|
|
79
|
+
duration: duration(params),
|
|
80
|
+
resolution: isDraft(params) ? 'hd' : resolution(params),
|
|
81
|
+
audio: params.apimartFlux3VideoAudio !== false,
|
|
82
|
+
};
|
|
83
|
+
if (isDraft(params))
|
|
84
|
+
body.draft = true;
|
|
85
|
+
// 显式 mode 优先级最高,避免平台在“同时有图和视频”时按续写处理而静默丢图。
|
|
86
|
+
if (isExtend(params)) {
|
|
87
|
+
if (videos.length !== 1)
|
|
88
|
+
throw new Error('FLUX 3 Video 视频续写需要 1 段视频');
|
|
89
|
+
body.mode = 'v2v';
|
|
90
|
+
body.video_url = videos[0];
|
|
91
|
+
}
|
|
92
|
+
else if (images.length > 0) {
|
|
93
|
+
if (images.length > 10)
|
|
94
|
+
throw new Error('FLUX 3 Video 最多支持 10 张关键帧');
|
|
95
|
+
body.mode = 'i2v';
|
|
96
|
+
// 顺序即语义:首张起始帧、末张结束帧,中间均匀分布。
|
|
97
|
+
body.image_urls = images;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
body.mode = 't2v';
|
|
101
|
+
}
|
|
102
|
+
const raw = String(params.apimartFlux3VideoAspectRatio || 'smart');
|
|
103
|
+
// 有图或续写时比例选项已隐藏,残留的取值也不能发,交给平台按素材选比例;纯文生视频回退 16:9。
|
|
104
|
+
body.aspect_ratio = body.mode !== 't2v' ? 'auto' : RATIOS.includes(raw) ? raw : '16:9';
|
|
105
|
+
return body;
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
pricing: {
|
|
109
|
+
currency: '$',
|
|
110
|
+
// 转正片按正片全价计费、草稿费用不抵扣;时长与模式沿用草稿的参数。
|
|
111
|
+
calculator: (params) => {
|
|
112
|
+
const kind = isExtend(params) ? 'extend' : 'generate';
|
|
113
|
+
if (isDraft(params) && !draftTaskId(params))
|
|
114
|
+
return DRAFT_RATES[kind] * duration(params);
|
|
115
|
+
return RATES[kind][resolution(params)] * duration(params);
|
|
116
|
+
},
|
|
117
|
+
description: '文/图生视频每秒 HD $0.136、FHD $0.232;视频续写每秒 HD $0.328、FHD $0.424;草稿每秒 $0.048(续写草稿 $0.096),转正片按正片全价另计;关闭音频不降价,续写实际时长偏短时按实际退还差额',
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
export default apimartFlux3VideoModel;
|