@acedatacloud/sdk 2026.824.0 → 2026.909.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.824.0",
3
+ "version": "2026.909.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 });
@@ -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
  }