@acedatacloud/sdk 2026.824.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/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/resources/providers/fish.ts +8 -7
- package/src/resources/providers/seedream.ts +34 -34
package/package.json
CHANGED
|
@@ -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"
|
|
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
|
-
/**
|
|
33
|
-
references?: Array<
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
21
|
-
model: "doubao-seedream-5-0-pro-260628" | "doubao-seedream-5-0-260128" | "doubao-seedream-
|
|
22
|
-
/**
|
|
23
|
-
prompt
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
size?: "1K" | "2K" | "3K" | "4K"
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
38
|
+
/** Output image format, jpeg or png. Supported by Seedream 5.0 Pro and Lite. */
|
|
37
39
|
outputFormat?: "jpeg" | "png";
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/**
|
|
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
|
-
/**
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
|
|
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
|
-
/**
|
|
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.
|
|
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.
|
|
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.
|
|
79
|
-
if (options.
|
|
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", "
|
|
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
|
}
|