@acedatacloud/sdk 2026.817.0 → 2026.905.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/sdk",
3
- "version": "2026.817.0",
3
+ "version": "2026.905.0",
4
4
  "description": "Official TypeScript SDK for AceDataCloud — AI-powered data services",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,15 +22,15 @@ export interface FishGenerateOptions {
22
22
  /** Top-p nucleus sampling parameter, controls output diversity. */
23
23
  topP?: number;
24
24
  /** Output audio format, default is `mp3`. */
25
- format?: "mp3" | "wav" | "pcm" | "opus";
25
+ format?: "mp3" | "wav" | "pcm";
26
26
  /** Delay mode. The upstream rejects null values, and defaults to `normal` when omitted. */
27
27
  latency?: "normal" | "balanced";
28
28
  /** Rhythm coverage parameters, forwarded as is to upstream (such as speech rate, volume, etc.). */
29
29
  prosody?: Record<string, unknown>;
30
30
  /** Is the input text subjected to text normalization processing by the upstream? */
31
31
  normalize?: boolean;
32
- /** Inline reference audio samples will be forwarded upstream as is, for zero-shot voice cloning. */
33
- references?: Array<Record<string, unknown>>;
32
+ /** One-shot voice clone reference; cannot be combined with reference_id. */
33
+ references?: Array<{ audio: string; text: string }>;
34
34
  /** MP3 bitrate when `format=mp3`. */
35
35
  mp3Bitrate?: number;
36
36
  /** Output the audio sampling rate (e.g., 16000, 22050, 44100). */
@@ -41,14 +41,15 @@ export interface FishGenerateOptions {
41
41
  chunkLength?: number;
42
42
  /** Opus bitrate when `format=opus`. */
43
43
  opusBitrate?: number;
44
- /** Voice model ID (single speaker). A string array can also be passed in multi-speaker scenarios. */
45
- referenceId?: string;
44
+ /** Saved/public voice ID; cannot be combined with references. */
45
+ referenceId?: string | string[];
46
46
  /** Maximum number of new tokens generated. */
47
47
  maxNewTokens?: number;
48
48
  /** Minimum block length. */
49
49
  minChunkLength?: number;
50
50
  /** The repetition penalty coefficient applied during the generation process. */
51
51
  repetitionPenalty?: number;
52
+ model?: "s1" | "s2-pro" | "s2.1-pro";
52
53
  /** Submit asynchronously and poll. Defaults to true. */
53
54
  async?: boolean;
54
55
  /** Wait for completion before returning the handle. */
@@ -108,13 +109,13 @@ export class Fish {
108
109
  if (options.minChunkLength !== undefined) body["min_chunk_length"] = options.minChunkLength;
109
110
  if (options.repetitionPenalty !== undefined) body["repetition_penalty"] = options.repetitionPenalty;
110
111
  for (const [key, value] of Object.entries(options)) {
111
- if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== undefined) {
112
+ if (!["async", "callbackUrl", "chunkLength", "format", "latency", "maxNewTokens", "maxWait", "minChunkLength", "model", "mp3Bitrate", "normalize", "opusBitrate", "pollInterval", "prosody", "referenceId", "references", "repetitionPenalty", "sampleRate", "temperature", "text", "topP", "wait"].includes(key) && value !== undefined) {
112
113
  body[key] = value;
113
114
  }
114
115
  }
115
116
  if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
116
117
  body.async = options.async ?? true;
117
- const result = (await this.transport.request('POST', "/fish/tts", { json: body })) as Record<string, unknown>;
118
+ const result = (await this.transport.request('POST', "/fish/tts", { json: body, headers: options.model !== undefined ? {"model": options.model} : {} })) as Record<string, unknown>;
118
119
  const handle = new TaskHandle(taskId(result), "/fish/tasks", this.transport, result);
119
120
  if (options.wait) {
120
121
  await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
@@ -12,6 +12,7 @@ export { Maestro } from './maestro';
12
12
  export { Minimax } from './minimax';
13
13
  export { NanoBanana } from './nano-banana';
14
14
  export { Producer } from './producer';
15
+ export { QwenImage } from './qwen-image';
15
16
  export { Seedance } from './seedance';
16
17
  export { Seedream } from './seedream';
17
18
  export { Suno } from './suno';
@@ -30,6 +31,7 @@ import { Maestro } from './maestro';
30
31
  import { Minimax } from './minimax';
31
32
  import { NanoBanana } from './nano-banana';
32
33
  import { Producer } from './producer';
34
+ import { QwenImage } from './qwen-image';
33
35
  import { Seedance } from './seedance';
34
36
  import { Seedream } from './seedream';
35
37
  import { Suno } from './suno';
@@ -49,6 +51,7 @@ export function attachProviders(client: Record<string, unknown>, transport: Tran
49
51
  client.minimax = new Minimax(transport);
50
52
  client.nanobanana = new NanoBanana(transport);
51
53
  client.producer = new Producer(transport);
54
+ client.qwenimage = new QwenImage(transport);
52
55
  client.seedance = new Seedance(transport);
53
56
  client.seedream = new Seedream(transport);
54
57
  client.suno = new Suno(transport);
@@ -0,0 +1,86 @@
1
+ /**
2
+ * QwenImage (qwen-image) — generated from the platform OpenAPI spec.
3
+ *
4
+ * Do not edit by hand: run `python scripts/generate_providers.py`. Parameter
5
+ * names, types, enums and required-ness all come from the live spec.
6
+ */
7
+
8
+ import { Transport } from '../../runtime/transport';
9
+ import { TaskHandle } from '../../runtime/tasks';
10
+
11
+
12
+ function taskId(result: Record<string, unknown>): string {
13
+ if (typeof result?.task_id === 'string') return result.task_id;
14
+ const data = result?.data as Record<string, unknown> | undefined;
15
+ if (data && typeof data.task_id === 'string') return data.task_id;
16
+ return typeof result?.id === 'string' ? result.id : '';
17
+ }
18
+
19
+ export interface QwenImageGenerateOptions {
20
+ /** $t(qwen_image_images_model) */
21
+ model: "qwen-image-3.0" | "qwen-image-3.0-pro";
22
+ /** $t(qwen_image_images_prompt) */
23
+ prompt: string;
24
+ /** $t(qwen_image_images_image_urls) */
25
+ imageUrls?: string[];
26
+ /** $t(qwen_image_images_n) */
27
+ n?: number;
28
+ /** $t(qwen_image_images_size) */
29
+ size?: string;
30
+ /** $t(qwen_image_images_prompt_extend) */
31
+ promptExtend?: boolean;
32
+ /** $t(qwen_image_images_prompt_extend_mode) */
33
+ promptExtendMode?: "direct" | "agent";
34
+ /** $t(qwen_image_images_enable_thinking) */
35
+ enableThinking?: boolean;
36
+ /** $t(qwen_image_images_negative_prompt) */
37
+ negativePrompt?: string;
38
+ /** $t(qwen_image_images_seed) */
39
+ seed?: number;
40
+ /** $t(qwen_image_images_watermark) */
41
+ watermark?: boolean;
42
+ /** Submit asynchronously and poll. Defaults to true. */
43
+ async?: boolean;
44
+ /** Wait for completion before returning the handle. */
45
+ wait?: boolean;
46
+ pollInterval?: number;
47
+ maxWait?: number;
48
+ callbackUrl?: string;
49
+ /** Any parameter added upstream before the SDK is regenerated. */
50
+ [key: string]: unknown;
51
+ }
52
+
53
+ /** qwen-image client. */
54
+ export class QwenImage {
55
+ constructor(private transport: Transport) {}
56
+
57
+ /** Call /qwen-image/images. */
58
+ async generate(options: QwenImageGenerateOptions): Promise<TaskHandle> {
59
+ const body: Record<string, unknown> = {};
60
+ body["model"] = options.model;
61
+ body["prompt"] = options.prompt;
62
+ if (options.imageUrls !== undefined) body["image_urls"] = options.imageUrls;
63
+ body["n"] = options.n ?? 1;
64
+ if (options.size !== undefined) body["size"] = options.size;
65
+ body["prompt_extend"] = options.promptExtend ?? true;
66
+ body["prompt_extend_mode"] = options.promptExtendMode ?? "direct";
67
+ body["enable_thinking"] = options.enableThinking ?? true;
68
+ if (options.negativePrompt !== undefined) body["negative_prompt"] = options.negativePrompt;
69
+ if (options.seed !== undefined) body["seed"] = options.seed;
70
+ body["watermark"] = options.watermark ?? false;
71
+ for (const [key, value] of Object.entries(options)) {
72
+ if (!["async", "callbackUrl", "enableThinking", "imageUrls", "maxWait", "model", "n", "negativePrompt", "pollInterval", "prompt", "promptExtend", "promptExtendMode", "seed", "size", "wait", "watermark"].includes(key) && value !== undefined) {
73
+ body[key] = value;
74
+ }
75
+ }
76
+ if (options.callbackUrl !== undefined) body.callback_url = options.callbackUrl;
77
+ body.async = options.async ?? true;
78
+ const result = (await this.transport.request('POST', "/qwen-image/images", { json: body })) as Record<string, unknown>;
79
+ const handle = new TaskHandle(taskId(result), "/qwen-image/tasks", this.transport, result);
80
+ if (options.wait) {
81
+ await handle.wait({ pollInterval: options.pollInterval, maxWait: options.maxWait });
82
+ }
83
+ return handle;
84
+ }
85
+
86
+ }
@@ -17,34 +17,34 @@ function taskId(result: Record<string, unknown>): string {
17
17
  }
18
18
 
19
19
  export interface SeedreamGenerateOptions {
20
- /** Models used for generating images. If not specified, the default is `doubao-seedream-5.0-lite`. `doubao-seedream-5.0-pro` is the latest flagship single image model (only generates single images, does not support group images, streaming, or online search). */
21
- model: "doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-260128" | "doubao-seedream-4-0-250828" | "doubao-seedream-4-5-251128" | "doubao-seedream-3-0-t2i-250415" | "doubao-seededit-3-0-i2i-250628";
22
- /** Prompts for generating images. */
23
- prompt: string;
24
- /** Generate a random seed for image generation. The supported range is [-1, 2147483647], with a default value of `-1`. **Only `doubao-seedream-3.0-t2i` supports this parameter** (according to the official Volcengine documentation), other models do not accept this parameter. */
25
- seed?: number;
26
- /** Generate image dimensions or aspect ratios. Supports preset options (`1K`/`2K`/`3K`/`4K`), or explicit `<width>x<height>` format (e.g., `1024x1024`). **Different models support different preset options**: `doubao-seedream-5.0-pro` supports `1K`/`2K`; `doubao-seedream-5.0-lite` supports `2K`/`3K`/`4K`; `doubao-seedream-4.5` only supports `2K`/`4K`; `doubao-seedream-4.0` supports `1K`/`2K`/`4K`; `doubao-seedream-3.0-t2i` and `doubao-seedream-3.0-i2i` **do not support** any preset options and must receive explicit `<width>x<height>` values. */
27
- size?: "1K" | "2K" | "3K" | "4K";
28
- /** Reference image links for image editing are required, supporting accessible http/https URLs, or base64 encoded image strings in the format `data:image/png;base64,iVBORw0KG...`. Each image must not exceed 10MB in size. This parameter is mandatory when using image-to-image models (such as `doubao-seededit-3.0-i2i`). */
29
- image?: string[];
30
- /** List of tools that can be called by the model. Currently, only `web_search` is supported. Applicable only to `doubao-seedream-5.0-lite`. */
31
- tools?: Array<Record<string, unknown>>;
32
- /** Whether to return all images in a streaming manner, default is `false`. Only supports `doubao-seedream-5.0-lite`, `doubao-seedream-4.5`, and `doubao-seedream-4.0`. */
20
+ /** Full model ID. Seedream 5.0 Pro supports single-image generation, precise editing, transparent backgrounds, and layer decomposition; Seedream 5.0 Lite supports single or sequential images, streaming, and web search. */
21
+ model: "doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-260128" | "doubao-seedream-5-0-lite-260128" | "doubao-seedream-4-0-250828" | "doubao-seedream-4-5-251128";
22
+ /** Generation or editing prompt. Optional only for Seedream 5.0 Pro layer decomposition, where omission automatically decomposes the main elements. */
23
+ prompt?: string;
24
+ /** One reference image URL/base64 string or an array. Pro accepts up to 10 images in regular mode and exactly one for decomposition; Lite/4.x accept up to 14. Each image must be at most 30 MB. */
25
+ image?: string | string[];
26
+ /** Output size. Pro supports 1K/1.5K/2K or valid dimensions; decomposition also supports auto. Lite supports 2K/3K/4K or valid dimensions. */
27
+ size?: "1K" | "1.5K" | "2K" | "3K" | "4K" | "auto" | `${number}x${number}`;
28
+ /** Sequential image mode. auto lets supported Lite/4.x models generate a related set; disabled returns one image. Not supported by Pro. */
29
+ sequentialImageGeneration?: "auto" | "disabled";
30
+ /** Sequential image options. max_images is 1-15 and input images plus outputs must not exceed 15. */
31
+ sequentialImageGenerationOptions?: Record<string, unknown>;
32
+ /** Stream normalized image events. Supported by Lite/4.x only and cannot be combined with async or callback_url. */
33
33
  stream?: boolean;
34
- /** Whether to add AI-generated watermark, default is `true`. */
34
+ /** Image response format: url or b64_json. */
35
+ responseFormat?: "url" | "b64_json";
36
+ /** Whether to add the AI-generated watermark. */
35
37
  watermark?: boolean;
36
- /** The output image file format is `jpeg` by default. Only `doubao-seedream-5.0-pro` and `doubao-seedream-5.0-lite` are supported. */
38
+ /** Output image format, jpeg or png. Supported by Seedream 5.0 Pro and Lite. */
37
39
  outputFormat?: "jpeg" | "png";
38
- /** Prompt word weight, the larger the value, the more relevant the generated result is to the prompt word. Only supports `doubao-seedream-3.0-t2i` (default value 2.5) and `doubao-seededit-3.0-i2i` (default value 5.5), both ranges are [1, 10]. */
39
- guidanceScale?: unknown;
40
- /** The response format defaults to `url`, and also supports `b64_json`. */
41
- responseFormat?: string;
42
- /** Optional prompt word optimization configuration. Only supports `doubao-seedream-5.0-lite`, `doubao-seedream-4.5` (only in `standard` mode), and `doubao-seedream-4.0`. */
40
+ /** Model tools. Seedream 5.0 Lite supports web_search. */
41
+ tools?: Array<Record<string, unknown>>;
42
+ /** Prompt optimization. Pro supports standard/fast; Lite and 4.5 support standard; 4.0 supports standard/fast. */
43
43
  optimizePromptOptions?: Record<string, unknown>;
44
- /** The default value is `disabled`. Setting it to `auto` allows the model to generate a set of stylistically coherent related images (multi-image consistency, sharing characters, styles, and details across frames). Only `doubao-seedream-5.0-lite`, `doubao-seedream-4.5`, and `doubao-seedream-4.0` are supported. */
45
- sequentialImageGeneration?: "auto" | "disabled";
46
- /** Adjustable parameters for batch image generation. Effective only when `sequential_image_generation=auto`. Only supports `doubao-seedream-5.0-lite`, `doubao-seedream-4.5`, and `doubao-seedream-4.0`. */
47
- sequentialImageGenerationOptions?: Record<string, unknown>;
44
+ /** Seedream 5.0 Pro layer decomposition. Requires exactly one PNG/JPEG and returns one base image plus up to 16 transparent PNG layers. */
45
+ layerDecomposition?: boolean;
46
+ /** Seedream 5.0 Pro background mode. transparent requires one transparent PNG input and PNG output; opaque produces a regular background. */
47
+ background?: "transparent" | "opaque";
48
48
  /** Submit asynchronously and poll. Defaults to true. */
49
49
  async?: boolean;
50
50
  /** Wait for completion before returning the handle. */
@@ -60,25 +60,25 @@ export interface SeedreamGenerateOptions {
60
60
  export class Seedream {
61
61
  constructor(private transport: Transport) {}
62
62
 
63
- /** ByteDance Seedream high-quality image generation and editing API. Supports text-to-image models doubao-seedream-3-0-t2i-250415, doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, doubao-seedream- */
63
+ /** Call /seedream/images. */
64
64
  async generate(options: SeedreamGenerateOptions): Promise<TaskHandle> {
65
65
  const body: Record<string, unknown> = {};
66
66
  body["model"] = options.model;
67
- body["prompt"] = options.prompt;
68
- if (options.seed !== undefined) body["seed"] = options.seed;
69
- if (options.size !== undefined) body["size"] = options.size;
67
+ if (options.prompt !== undefined) body["prompt"] = options.prompt;
70
68
  if (options.image !== undefined) body["image"] = options.image;
71
- if (options.tools !== undefined) body["tools"] = options.tools;
69
+ if (options.size !== undefined) body["size"] = options.size;
70
+ if (options.sequentialImageGeneration !== undefined) body["sequential_image_generation"] = options.sequentialImageGeneration;
71
+ if (options.sequentialImageGenerationOptions !== undefined) body["sequential_image_generation_options"] = options.sequentialImageGenerationOptions;
72
72
  if (options.stream !== undefined) body["stream"] = options.stream;
73
+ if (options.responseFormat !== undefined) body["response_format"] = options.responseFormat;
73
74
  if (options.watermark !== undefined) body["watermark"] = options.watermark;
74
75
  if (options.outputFormat !== undefined) body["output_format"] = options.outputFormat;
75
- if (options.guidanceScale !== undefined) body["guidance_scale"] = options.guidanceScale;
76
- if (options.responseFormat !== undefined) body["response_format"] = options.responseFormat;
76
+ if (options.tools !== undefined) body["tools"] = options.tools;
77
77
  if (options.optimizePromptOptions !== undefined) body["optimize_prompt_options"] = options.optimizePromptOptions;
78
- if (options.sequentialImageGeneration !== undefined) body["sequential_image_generation"] = options.sequentialImageGeneration;
79
- if (options.sequentialImageGenerationOptions !== undefined) body["sequential_image_generation_options"] = options.sequentialImageGenerationOptions;
78
+ if (options.layerDecomposition !== undefined) body["layer_decomposition"] = options.layerDecomposition;
79
+ if (options.background !== undefined) body["background"] = options.background;
80
80
  for (const [key, value] of Object.entries(options)) {
81
- if (!["async", "callbackUrl", "guidanceScale", "image", "maxWait", "model", "optimizePromptOptions", "outputFormat", "pollInterval", "prompt", "responseFormat", "seed", "sequentialImageGeneration", "sequentialImageGenerationOptions", "size", "stream", "tools", "wait", "watermark"].includes(key) && value !== undefined) {
81
+ if (!["async", "background", "callbackUrl", "image", "layerDecomposition", "maxWait", "model", "optimizePromptOptions", "outputFormat", "pollInterval", "prompt", "responseFormat", "sequentialImageGeneration", "sequentialImageGenerationOptions", "size", "stream", "tools", "wait", "watermark"].includes(key) && value !== undefined) {
82
82
  body[key] = value;
83
83
  }
84
84
  }
@@ -17,32 +17,40 @@ function taskId(result: Record<string, unknown>): string {
17
17
  }
18
18
 
19
19
  export interface WanGenerateOptions {
20
- /** Models for generating videos include optional values such as `wan2.6-t2v` (text-to-video), `wan2.6-i2v` (image-to-video), `wan2.6-i2v-flash` (fast version of image-to-video), and `wan2.6-r2v` (reference video generation). */
21
- model: "wan2.6-i2v" | "wan2.6-r2v" | "wan2.6-i2v-flash" | "wan2.6-t2v";
22
- /** Operation types. `text2video` indicates text-to-video, and `image2video` indicates image-to-video. */
23
- action: "text2video" | "image2video";
24
- /** Prompts for generating videos. */
25
- prompt: string;
26
- /** Video size specifications. */
27
- size?: string;
28
- /** Specify whether the generated video contains sound. */
20
+ /** $t(wan_videos_model) */
21
+ model: "wan2.6-i2v" | "wan2.6-r2v" | "wan2.6-i2v-flash" | "wan2.6-t2v" | "wan3.0-video";
22
+ /** $t(wan_videos_audio) */
29
23
  audio?: boolean;
30
- /** Specify the duration of the video to be generated (in seconds), with optional values of `5`, `10`, or `15`. */
31
- duration?: number;
32
- /** The URL of the audio file, the model will generate the corresponding video based on that audio. */
33
- audioUrl?: string;
34
- /** The URL of the starting frame image, which will serve as the first frame of the generated video. */
35
- imageUrl?: string;
36
- /** Specify the type of shots for the video, that is, whether the video consists of a single continuous shot (`single`) or multiple switching shots (`multi`). */
37
- shotType?: "single" | "multi";
38
- /** Specify the resolution level for generating the video, used to adjust the video clarity (total pixel count). The model will automatically scale to a similar total pixel count based on the selected resolution level, and the aspect ratio of the generated video will strive to remain consistent with the aspect ratio of the input image `image_url`. */
39
- resolution?: "480P" | "720P" | "1080P";
40
- /** Whether to enable intelligent rewriting of prompts. Once enabled, a large model will be used to intelligently expand the input prompts, which can significantly improve the generation effect of shorter prompts, but will increase processing time. */
24
+ /** $t(wan_videos_prompt_extend) */
41
25
  promptExtend?: boolean;
42
- /** Reverse prompt words, used to describe content that is not desired to appear in the video footage, can be used to limit the video visuals. Supports both Chinese and English, with a length not exceeding 500 characters; any excess will be automatically truncated. */
26
+ /** $t(wan_videos_action) */
27
+ action?: "text2video" | "image2video";
28
+ /** $t(wan_videos_resolution) */
29
+ resolution?: "480P" | "720P" | "1080P";
30
+ /** $t(wan_videos_shot_type) */
31
+ shotType?: "single" | "multi";
32
+ /** $t(wan_videos_duration) */
33
+ duration?: number;
34
+ /** $t(wan_videos_prompt) */
35
+ prompt?: string;
36
+ /** $t(wan_videos_negative_prompt) */
43
37
  negativePrompt?: string;
44
- /** An array of URLs for reference video files, used to extract the character images (and vocal tones, if any) from the reference videos to generate videos that match the reference features. */
38
+ /** $t(wan_videos_size) */
39
+ size?: string;
40
+ /** $t(wan_videos_audio_url) */
41
+ audioUrl?: string;
42
+ /** $t(wan_videos_reference_video_urls) */
45
43
  referenceVideoUrls?: string[];
44
+ /** $t(wan_videos_image_url) */
45
+ imageUrl?: string;
46
+ /** $t(wan_videos_media) */
47
+ media?: Array<Record<string, unknown>>;
48
+ /** $t(wan_videos_ratio) */
49
+ ratio?: "adaptive" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
50
+ /** $t(wan_videos_seed) */
51
+ seed?: number;
52
+ /** $t(wan_videos_watermark) */
53
+ watermark?: boolean;
46
54
  /** Submit asynchronously and poll. Defaults to true. */
47
55
  async?: boolean;
48
56
  /** Wait for completion before returning the handle. */
@@ -62,20 +70,24 @@ export class Wan {
62
70
  async generate(options: WanGenerateOptions): Promise<TaskHandle> {
63
71
  const body: Record<string, unknown> = {};
64
72
  body["model"] = options.model;
65
- body["action"] = options.action;
66
- body["prompt"] = options.prompt;
67
- if (options.size !== undefined) body["size"] = options.size;
68
73
  body["audio"] = options.audio ?? false;
69
- if (options.duration !== undefined) body["duration"] = options.duration;
70
- if (options.audioUrl !== undefined) body["audio_url"] = options.audioUrl;
71
- if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
72
- if (options.shotType !== undefined) body["shot_type"] = options.shotType;
73
- if (options.resolution !== undefined) body["resolution"] = options.resolution;
74
74
  body["prompt_extend"] = options.promptExtend ?? false;
75
+ body["action"] = options.action ?? "text2video";
76
+ if (options.resolution !== undefined) body["resolution"] = options.resolution;
77
+ if (options.shotType !== undefined) body["shot_type"] = options.shotType;
78
+ if (options.duration !== undefined) body["duration"] = options.duration;
79
+ if (options.prompt !== undefined) body["prompt"] = options.prompt;
75
80
  if (options.negativePrompt !== undefined) body["negative_prompt"] = options.negativePrompt;
81
+ if (options.size !== undefined) body["size"] = options.size;
82
+ if (options.audioUrl !== undefined) body["audio_url"] = options.audioUrl;
76
83
  if (options.referenceVideoUrls !== undefined) body["reference_video_urls"] = options.referenceVideoUrls;
84
+ if (options.imageUrl !== undefined) body["image_url"] = options.imageUrl;
85
+ if (options.media !== undefined) body["media"] = options.media;
86
+ if (options.ratio !== undefined) body["ratio"] = options.ratio;
87
+ if (options.seed !== undefined) body["seed"] = options.seed;
88
+ body["watermark"] = options.watermark ?? false;
77
89
  for (const [key, value] of Object.entries(options)) {
78
- if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "referenceVideoUrls", "resolution", "shotType", "size", "wait"].includes(key) && value !== undefined) {
90
+ if (!["action", "async", "audio", "audioUrl", "callbackUrl", "duration", "imageUrl", "maxWait", "media", "model", "negativePrompt", "pollInterval", "prompt", "promptExtend", "ratio", "referenceVideoUrls", "resolution", "seed", "shotType", "size", "wait", "watermark"].includes(key) && value !== undefined) {
79
91
  body[key] = value;
80
92
  }
81
93
  }