@lingjingai/lj-awb-cli 0.5.7 → 0.5.14
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/README.md +7 -3
- package/package.json +1 -1
- package/packages/awb-cli/package.json +2 -2
- package/packages/awb-core/package.json +1 -1
- package/packages/awb-core/src/api.js +8 -0
- package/packages/awb-core/src/commands.js +76 -1
- package/packages/awb-core/src/common.js +6 -0
- package/packages/awb-core/src/output.js +27 -8
- package/packages/awb-core/src/services.js +318 -17
- package/packages/awb-core/src/standalone.js +27 -8
- package/skills/lj-awb/SKILL.md +7 -5
- package/skills/lj-awb/VERSION +1 -1
- package/skills/lj-awb/compat.json +3 -3
- package/skills/lj-awb/modules/create.md +14 -2
- package/skills/lj-awb/modules/driver.md +7 -7
- package/skills/lj-awb/modules/model.md +6 -3
- package/skills/lj-awb/modules/task-manual.md +3 -0
- package/skills/lj-awb/references/volcengine-voice-types.md +455 -0
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@ CLI 本身只负责平台调用、参数校验、人类友好输出、机器可
|
|
|
20
20
|
| 账号 | `account` | 用户、团队和登录上下文 |
|
|
21
21
|
| 项目 | `project` | 项目组查询、切换、创建和更新 |
|
|
22
22
|
| 积分 | `credits` | 可扣积分余额、项目组预算、任务用量统计 |
|
|
23
|
-
| 模型 | `model` | 生图 /
|
|
23
|
+
| 模型 | `model` | 生图 / 生视频 / 音频模型发现、模型参数白名单 |
|
|
24
24
|
| 上传 | `upload` | 本地图片 / 视频 / 音频上传为平台可访问素材 |
|
|
25
|
-
| 创建 | `create` |
|
|
25
|
+
| 创建 | `create` | 生图、生视频、音频、主体、音色、素材和去字幕提交 |
|
|
26
26
|
| 任务 | `task` | 任务列表、等待、任务台账和台账轮询 |
|
|
27
27
|
|
|
28
28
|
## 环境要求
|
|
@@ -165,6 +165,7 @@ lj-awb credits balance
|
|
|
165
165
|
lj-awb credits usage --project-group-no <no> --last-hours 24
|
|
166
166
|
lj-awb model image-models --model Banana
|
|
167
167
|
lj-awb model video-models --model Seedance
|
|
168
|
+
lj-awb model audio-models --model "Seed Audio"
|
|
168
169
|
lj-awb model input-guide
|
|
169
170
|
lj-awb model options --model-group-code <modelGroupCode>
|
|
170
171
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
@@ -175,6 +176,9 @@ lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
|
175
176
|
```bash
|
|
176
177
|
lj-awb create image ... --dry-run
|
|
177
178
|
lj-awb create image ... --yes
|
|
179
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --dry-run
|
|
180
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "海浪与钢琴" --duration 12 --yes
|
|
181
|
+
lj-awb create audio --model-group-code <modelGroupCode> --prompt "使用指定音色生成配乐" --duration 12 --speaker <speaker-id> --yes
|
|
178
182
|
```
|
|
179
183
|
|
|
180
184
|
缺少 `--yes` 时,CLI 返回 `confirmation_required`,退出码为 `10`。`task wait` 超时返回 `task_still_running`,退出码为 `20`。
|
|
@@ -217,7 +221,7 @@ lj-awb model options --model-group-code <modelGroupCode>
|
|
|
217
221
|
lj-awb model create-spec --model-group-code <modelGroupCode>
|
|
218
222
|
```
|
|
219
223
|
|
|
220
|
-
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
224
|
+
`model input-guide` 返回跨模型统一参数、`resources` 字段和 `reference_key` 规则。`model options` 专门返回模型参数、资源媒体约束和条件约束,例如 `params[].values`、`params[].defaultValue`、`resources[].mediaType`、`resources[].usage`、`resources[].fileTypes`、`resources[].maxFiles`、`resources[].supportLastFrameOnly`、`resources[].minDurationMs/maxDurationMs`、`constraints[].target`、`constraints[].conditions`。`model create-spec` 专门返回如何创建任务,例如 `inputRequirement`、`supportedIntents`、`preflight` 和 `examples`。默认 text 已经覆盖常用决策字段;只有脚本严格解析或需要完整嵌套结构时才追加 `-f json`。Agent 应用 `options` 选参数值、校验素材并判断联动约束,再用 `create-spec` 组装 `create image` / `create video` / `create audio`,不要直接把平台旧参数传给 create。上传音频是 `resources` 素材输入,具体 `audio:reference` 写法看 `input-guide` / `create-spec`;是否需要输出音效才使用 `--need-audio true/false`。
|
|
221
225
|
|
|
222
226
|
## 示例:参考图生成视频
|
|
223
227
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingjingai/awb-cli-bin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
4
4
|
"description": "Standalone CLI for Lingjing AWB",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@lingjingai/awb-core": "0.5.
|
|
16
|
+
"@lingjingai/awb-core": "0.5.14"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -236,6 +236,14 @@ export async function createVideoTask(payload = {}) {
|
|
|
236
236
|
return await apiFetch('/api/material/creation/videoCreate', { body: payload });
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
export async function fetchAudioFee(payload = {}) {
|
|
240
|
+
return await apiFetch('/api/material/creation/audioCreateFeeCalc', { body: payload });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export async function createAudioTask(payload = {}) {
|
|
244
|
+
return await apiFetch('/api/material/creation/audioCreate', { body: payload });
|
|
245
|
+
}
|
|
246
|
+
|
|
239
247
|
export async function fetchTaskInfo(taskId) {
|
|
240
248
|
return await apiFetch('/api/material/creation/task/info', {
|
|
241
249
|
method: 'GET',
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
assetGroupUpdate,
|
|
10
10
|
assetMatchActor,
|
|
11
11
|
assetReviewModels,
|
|
12
|
+
audioCreate,
|
|
13
|
+
audioFee,
|
|
12
14
|
assetRegister,
|
|
13
15
|
authLogin,
|
|
14
16
|
authLogout,
|
|
@@ -84,7 +86,7 @@ const MODEL_GROUP_ARG = { name: 'model-group-code', valueName: 'code', descripti
|
|
|
84
86
|
const ASSET_PLATFORM_ARG = { name: 'platform', valueName: 'platform', description: '素材加白平台,必须显式传 JIMENG 或 BYTEPLUS,不做别名推断' };
|
|
85
87
|
const MODEL_LIST_ARGS = [
|
|
86
88
|
{ name: 'model', valueName: 'keyword', description: '按模型名、编码、供应商或输入方式过滤;不传时查询全部' },
|
|
87
|
-
{ name: 'usage', valueName: 'usage', description: '模型用途:image
|
|
89
|
+
{ name: 'usage', valueName: 'usage', description: '模型用途:image=IMAGE_CREATE,video=VIDEO_CREATE,audio=AUDIO_CREATE。取值大小写不敏感' },
|
|
88
90
|
{ name: 'provider', valueName: 'keyword', description: '按厂商过滤(大小写不敏感子串,如 字节 / GPT / Google)' },
|
|
89
91
|
{ name: 'input-mode', valueName: 'mode', description: '按输入方式过滤(对模型 inputModes 做成员匹配,如 reference / prompt_only / frames)' },
|
|
90
92
|
{ name: 'supports', valueName: 'param', description: '按支持的可调参数过滤(对 params 做成员匹配,如 quality / ratio / duration / needAudio)' },
|
|
@@ -484,6 +486,15 @@ export function registerAwbCommands(cli) {
|
|
|
484
486
|
func: async (_ctx, kwargs) => listModels('video', kwargs),
|
|
485
487
|
});
|
|
486
488
|
|
|
489
|
+
cli({
|
|
490
|
+
name: 'model audio-models',
|
|
491
|
+
description: commandHelp('查询 CLI 可用音频生成模型', {
|
|
492
|
+
examples: ['lj-awb model audio-models', 'lj-awb model audio-models --all'],
|
|
493
|
+
}),
|
|
494
|
+
args: MODEL_LIST_ARGS,
|
|
495
|
+
func: async (_ctx, kwargs) => listModels('audio', kwargs),
|
|
496
|
+
});
|
|
497
|
+
|
|
487
498
|
cli({
|
|
488
499
|
name: 'model asset-review-models',
|
|
489
500
|
description: commandHelp('查询支持素材加白的模型组与平台平铺关系', {
|
|
@@ -716,6 +727,70 @@ export function registerAwbCommands(cli) {
|
|
|
716
727
|
func: async (_ctx, kwargs) => videoCreateBatch(kwargs),
|
|
717
728
|
});
|
|
718
729
|
|
|
730
|
+
cli({
|
|
731
|
+
name: 'create audio-fee',
|
|
732
|
+
description: commandHelp('计算音频生成预计积分', {
|
|
733
|
+
examples: [
|
|
734
|
+
'lj-awb create audio-fee --model-group-code <code> --prompt "海浪与钢琴" --duration 12',
|
|
735
|
+
],
|
|
736
|
+
hint: '积分按时长向上取整:每 1-6 秒 1 积分。默认输出 mp3。',
|
|
737
|
+
}),
|
|
738
|
+
args: [
|
|
739
|
+
MODEL_GROUP_ARG,
|
|
740
|
+
PROJECT_GROUP_ARG,
|
|
741
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
742
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
743
|
+
{ name: 'speaker', valueName: 'voice-type', description: '火山音色表的 voice_type,可选;不能传中文或英文音色名称' },
|
|
744
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
745
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
746
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
747
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
748
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
749
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
750
|
+
...MODEL_PARAM_ARGS,
|
|
751
|
+
RESOURCE_ARG,
|
|
752
|
+
RESOURCES_JSON_ARG,
|
|
753
|
+
FEE_DRY_RUN_ARG,
|
|
754
|
+
],
|
|
755
|
+
allowDynamicModelParams: true,
|
|
756
|
+
func: async (_ctx, kwargs) => audioFee(kwargs),
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
cli({
|
|
760
|
+
name: 'create audio',
|
|
761
|
+
description: commandHelp('提交音频生成任务;正式执行需要 --yes', {
|
|
762
|
+
examples: [
|
|
763
|
+
'lj-awb create audio --model-group-code <code> --prompt "海浪与钢琴" --duration 12 --dry-run',
|
|
764
|
+
'lj-awb create audio --model-group-code <code> --prompt "使用指定音色生成配乐" --duration 12 --speaker <speaker-id> --yes',
|
|
765
|
+
'lj-awb create audio --model-group-code <code> --prompt "延续参考音频氛围" --duration 12 --resource audio:reference=./ref.mp3 --yes',
|
|
766
|
+
'lj-awb create audio --model-group-code <code> --prompt "根据画面生成环境声" --duration 8 --resource image:reference=./scene.png --yes',
|
|
767
|
+
],
|
|
768
|
+
hint: '最多 3 个参考音频或 1 张参考图,两类素材不能混用;默认输出 mp3。',
|
|
769
|
+
}),
|
|
770
|
+
args: [
|
|
771
|
+
MODEL_GROUP_ARG,
|
|
772
|
+
PROJECT_GROUP_ARG,
|
|
773
|
+
{ name: 'prompt', valueName: 'text', description: '音频生成提示词' },
|
|
774
|
+
{ name: 'duration', valueName: 'seconds', description: '生成时长,1-120 秒' },
|
|
775
|
+
{ name: 'speaker', valueName: 'voice-type', description: '火山音色表的 voice_type,可选;不能传中文或英文音色名称' },
|
|
776
|
+
{ name: 'audio-format', valueName: 'format', description: '输出格式:mp3(默认)、wav、pcm、ogg_opus' },
|
|
777
|
+
{ name: 'sample-rate', valueName: 'hz', description: '采样率,8000-48000' },
|
|
778
|
+
{ name: 'speech-rate', valueName: 'value', description: '语速调节,-50 到 100' },
|
|
779
|
+
{ name: 'loudness-rate', valueName: 'value', description: '响度调节,-50 到 100' },
|
|
780
|
+
{ name: 'pitch-rate', valueName: 'value', description: '音高调节,-12 到 12' },
|
|
781
|
+
{ name: 'enable-subtitle', valueName: 'bool', description: '是否生成字幕信息(true/false)' },
|
|
782
|
+
...MODEL_PARAM_ARGS,
|
|
783
|
+
RESOURCE_ARG,
|
|
784
|
+
RESOURCES_JSON_ARG,
|
|
785
|
+
TASK_RECORD_ARG,
|
|
786
|
+
...CREATE_WAIT_ARGS,
|
|
787
|
+
DRY_RUN_ARG,
|
|
788
|
+
YES_ARG,
|
|
789
|
+
],
|
|
790
|
+
allowDynamicModelParams: true,
|
|
791
|
+
func: async (_ctx, kwargs) => audioCreate(kwargs),
|
|
792
|
+
});
|
|
793
|
+
|
|
719
794
|
cli({
|
|
720
795
|
name: 'create video-subtitle-removal',
|
|
721
796
|
description: commandHelp('基于 material 来源视频任务提交去字幕任务', {
|
|
@@ -32,6 +32,7 @@ export const TASK_UPLOAD_SCENE = {
|
|
|
32
32
|
IMAGE_EDIT: 'material-image-edit',
|
|
33
33
|
VIDEO_CREATE: 'material-video-create',
|
|
34
34
|
VIDEO_GROUP: 'material-video-create',
|
|
35
|
+
AUDIO_CREATE: 'material-video-create',
|
|
35
36
|
SUBJECT: 'material-video-create',
|
|
36
37
|
ASSET_REVIEW: 'asset-review',
|
|
37
38
|
DEFAULT: 'material-image-draw',
|
|
@@ -345,6 +346,11 @@ export function guessMimeType(filePath) {
|
|
|
345
346
|
return 'audio/mpeg';
|
|
346
347
|
case '.wav':
|
|
347
348
|
return 'audio/wav';
|
|
349
|
+
case '.ogg':
|
|
350
|
+
case '.oga':
|
|
351
|
+
return 'audio/ogg';
|
|
352
|
+
case '.pcm':
|
|
353
|
+
return 'audio/L16';
|
|
348
354
|
case '.m4a':
|
|
349
355
|
return 'audio/mp4';
|
|
350
356
|
case '.mp4':
|
|
@@ -212,7 +212,7 @@ function normalizeDryRun(data = {}) {
|
|
|
212
212
|
|
|
213
213
|
function submissionStatusCommand(commandName, data = {}) {
|
|
214
214
|
if (!data?.taskId) return null;
|
|
215
|
-
if (commandName === 'create image' || commandName === 'create video') {
|
|
215
|
+
if (commandName === 'create image' || commandName === 'create video' || commandName === 'create audio') {
|
|
216
216
|
return `${commandPrefix()} task status --task-id ${data.taskId}`;
|
|
217
217
|
}
|
|
218
218
|
return null;
|
|
@@ -530,12 +530,14 @@ export function normalizeOutputData(commandName, data) {
|
|
|
530
530
|
switch (commandName) {
|
|
531
531
|
case 'create image':
|
|
532
532
|
case 'create video':
|
|
533
|
+
case 'create audio':
|
|
533
534
|
case 'create video-super-resolution':
|
|
534
535
|
return normalizeTaskSubmission(commandName, data);
|
|
535
536
|
case 'create video-subtitle-removal':
|
|
536
537
|
return normalizeSubtitleSubmission(data);
|
|
537
538
|
case 'create image-fee':
|
|
538
539
|
case 'create video-fee':
|
|
540
|
+
case 'create audio-fee':
|
|
539
541
|
case 'create video-super-resolution-fee':
|
|
540
542
|
return normalizeFee(data);
|
|
541
543
|
case 'account info':
|
|
@@ -569,6 +571,7 @@ export function normalizeOutputData(commandName, data) {
|
|
|
569
571
|
return normalizeAsset(data);
|
|
570
572
|
case 'model image-models':
|
|
571
573
|
case 'model video-models':
|
|
574
|
+
case 'model audio-models':
|
|
572
575
|
case 'model asset-review-models':
|
|
573
576
|
return normalizeList(data, ['models', 'items', 'rows']);
|
|
574
577
|
case 'account teams':
|
|
@@ -1234,6 +1237,7 @@ function formatModelInputGuideOutput(data = {}) {
|
|
|
1234
1237
|
lines.push('next:');
|
|
1235
1238
|
pushSectionKeyValue(lines, 'imageModels', `${commandPrefix()} model image-models --model <keyword>`);
|
|
1236
1239
|
pushSectionKeyValue(lines, 'videoModels', `${commandPrefix()} model video-models --model <keyword>`);
|
|
1240
|
+
pushSectionKeyValue(lines, 'audioModels', `${commandPrefix()} model audio-models --model <keyword>`);
|
|
1237
1241
|
pushSectionKeyValue(lines, 'options', `${commandPrefix()} model options --model-group-code <modelGroupCode>`);
|
|
1238
1242
|
return `${lines.join('\n')}\n`;
|
|
1239
1243
|
}
|
|
@@ -1243,7 +1247,7 @@ function defaultJsonCommand(commandName) {
|
|
|
1243
1247
|
}
|
|
1244
1248
|
|
|
1245
1249
|
function modelListNextCommand(commandName) {
|
|
1246
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') {
|
|
1250
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') {
|
|
1247
1251
|
return `${commandPrefix()} model options --model-group-code <modelGroupCode>`;
|
|
1248
1252
|
}
|
|
1249
1253
|
if (commandName === 'model asset-review-models') {
|
|
@@ -1253,7 +1257,7 @@ function modelListNextCommand(commandName) {
|
|
|
1253
1257
|
}
|
|
1254
1258
|
|
|
1255
1259
|
function modelListAgentHint(commandName) {
|
|
1256
|
-
if (commandName !== 'model image-models' && commandName !== 'model video-models') return null;
|
|
1260
|
+
if (commandName !== 'model image-models' && commandName !== 'model video-models' && commandName !== 'model audio-models') return null;
|
|
1257
1261
|
return '对每个候选运行 model options,并把候选模型、参数取值、默认值和资源能力展示给用户后再推荐或进入 fee/dry-run。';
|
|
1258
1262
|
}
|
|
1259
1263
|
|
|
@@ -1296,6 +1300,7 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1296
1300
|
'credits redeem': 'redeem_result',
|
|
1297
1301
|
'model image-models': 'model_list',
|
|
1298
1302
|
'model video-models': 'model_list',
|
|
1303
|
+
'model audio-models': 'model_list',
|
|
1299
1304
|
'model asset-review-models': 'asset_review_model_list',
|
|
1300
1305
|
'model options': 'model_options',
|
|
1301
1306
|
'model create-spec': 'model_create_spec',
|
|
@@ -1306,6 +1311,8 @@ const OUTPUT_KIND_BY_COMMAND = {
|
|
|
1306
1311
|
'create image-batch': 'batch_task_submission',
|
|
1307
1312
|
'create video-fee': 'fee_estimate',
|
|
1308
1313
|
'create video': 'task_submission',
|
|
1314
|
+
'create audio-fee': 'fee_estimate',
|
|
1315
|
+
'create audio': 'task_submission',
|
|
1309
1316
|
'create video-batch': 'batch_task_submission',
|
|
1310
1317
|
'create video-super-resolution-fee': 'fee_estimate',
|
|
1311
1318
|
'create video-super-resolution': 'task_submission',
|
|
@@ -1391,6 +1398,7 @@ const COMMAND_TITLES = {
|
|
|
1391
1398
|
'project ensure': '项目组确保结果',
|
|
1392
1399
|
'create image': '生图任务提交结果',
|
|
1393
1400
|
'create video': '生视频任务提交结果',
|
|
1401
|
+
'create audio': '音频任务提交结果',
|
|
1394
1402
|
'create image-batch': '批量生图提交结果',
|
|
1395
1403
|
'create video-batch': '批量生视频提交结果',
|
|
1396
1404
|
'create video-super-resolution-fee': '视频超分积分预估',
|
|
@@ -1636,6 +1644,7 @@ const DRY_RUN_FIELDS_BY_COMMAND = {
|
|
|
1636
1644
|
'upload files': ['dryRun', 'fileCount', 'localFileCount', 'resourceConversionCount'],
|
|
1637
1645
|
'create image': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'ratio', 'quality', 'generateNum', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1638
1646
|
'create video': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'ratio', 'quality', 'needAudio', 'resourceCount', 'localFileCount', 'assetCount'],
|
|
1647
|
+
'create audio': ['dryRun', 'action', 'modelGroupCode', 'projectGroupNo', 'prompt', 'duration', 'audioFormat', 'resourceCount', 'localFileCount'],
|
|
1639
1648
|
'create image-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1640
1649
|
'create video-batch': ['dryRun', 'count', 'modelGroupCode', 'projectGroupNo'],
|
|
1641
1650
|
'create video-super-resolution-fee': ['dryRun', 'action', 'objectName', 'projectGroupNo', 'pointCost', 'billingPointBalance', 'billingPointRemainingAfter', 'projectBudgetBalance', 'projectBudgetMax', 'projectBudgetRemainingAfter'],
|
|
@@ -2275,15 +2284,17 @@ function namedListTitle(listKey) {
|
|
|
2275
2284
|
function localizedTaskKind(value) {
|
|
2276
2285
|
if (value === 'image' || value === 'IMAGE_CREATE') return '图片生成';
|
|
2277
2286
|
if (value === 'video' || value === 'VIDEO_CREATE') return '视频生成';
|
|
2287
|
+
if (value === 'audio' || value === 'AUDIO_CREATE') return '音频生成';
|
|
2278
2288
|
return prettyValue(value);
|
|
2279
2289
|
}
|
|
2280
2290
|
|
|
2281
2291
|
function localizedInputMode(value, taskKind = '') {
|
|
2282
2292
|
const mode = String(value || '');
|
|
2283
2293
|
const isVideo = taskKind === 'video' || taskKind === 'VIDEO_CREATE';
|
|
2294
|
+
const isAudio = taskKind === 'audio' || taskKind === 'AUDIO_CREATE';
|
|
2284
2295
|
const labels = {
|
|
2285
|
-
prompt_only: isVideo ? '文本生成视频' : '文本生成图片',
|
|
2286
|
-
reference: isVideo ? '参考素材生成' : '参考图生成',
|
|
2296
|
+
prompt_only: isAudio ? '文本生成音频' : (isVideo ? '文本生成视频' : '文本生成图片'),
|
|
2297
|
+
reference: isAudio ? '参考素材生成音频' : (isVideo ? '参考素材生成' : '参考图生成'),
|
|
2287
2298
|
frames: '首帧/尾帧生成',
|
|
2288
2299
|
storyboard: '分镜多镜头',
|
|
2289
2300
|
keyframe: '关键帧生成',
|
|
@@ -2302,6 +2313,13 @@ function localizedParamKey(value) {
|
|
|
2302
2313
|
needAudio: '生成音频',
|
|
2303
2314
|
need_audio: '生成音频',
|
|
2304
2315
|
prompt_optimizer: '提示词增强',
|
|
2316
|
+
speaker: '音色 ID',
|
|
2317
|
+
audio_format: '音频格式',
|
|
2318
|
+
sample_rate: '采样率',
|
|
2319
|
+
speech_rate: '语速',
|
|
2320
|
+
loudness_rate: '响度',
|
|
2321
|
+
pitch_rate: '音高',
|
|
2322
|
+
enable_subtitle: '生成字幕',
|
|
2305
2323
|
};
|
|
2306
2324
|
return labels[value] || value;
|
|
2307
2325
|
}
|
|
@@ -2589,7 +2607,7 @@ function pushReadableRecord(lines, record = {}, fields = [], options = {}) {
|
|
|
2589
2607
|
function formatPrettyModelList(commandName, data = {}, context = {}) {
|
|
2590
2608
|
const normalized = normalizeOutputData(commandName, data);
|
|
2591
2609
|
const rows = Array.isArray(normalized.models) ? normalized.models : [];
|
|
2592
|
-
const taskKind = commandName === 'model video-models' ? 'video' : 'image';
|
|
2610
|
+
const taskKind = commandName === 'model video-models' ? 'video' : (commandName === 'model audio-models' ? 'audio' : 'image');
|
|
2593
2611
|
const limit = listLimitFor(commandName, context, rows);
|
|
2594
2612
|
const visibleRows = rows.slice(0, Number.isFinite(limit) ? limit : rows.length);
|
|
2595
2613
|
const lines = [prettyTitle(commandName, 'model_list', normalized), ''];
|
|
@@ -2889,6 +2907,7 @@ function formatPrettyModelInputGuide(data = {}, context = {}) {
|
|
|
2889
2907
|
renderNextActions(lines, [
|
|
2890
2908
|
{ label: '生图模型', value: `${commandPrefix()} model image-models --model <keyword>` },
|
|
2891
2909
|
{ label: '生视频模型', value: `${commandPrefix()} model video-models --model <keyword>` },
|
|
2910
|
+
{ label: '音频模型', value: `${commandPrefix()} model audio-models --model <keyword>` },
|
|
2892
2911
|
{ label: '模型参数', value: `${commandPrefix()} model options --model-group-code <modelGroupCode>` },
|
|
2893
2912
|
...(context.textCommand ? [{ label: 'Agent 读取', value: context.textCommand }] : []),
|
|
2894
2913
|
...(context.jsonCommand ? [{ label: '完整 JSON', value: context.jsonCommand }] : []),
|
|
@@ -2929,7 +2948,7 @@ function formatPrettyGeneric(commandName, data, context = {}) {
|
|
|
2929
2948
|
export function formatPrettyOutput(commandName, data, context = {}) {
|
|
2930
2949
|
if (commandName === 'schema') return formatPrettySchema(data, context);
|
|
2931
2950
|
if (commandName === 'doctor') return formatPrettyEnvironment(data, context);
|
|
2932
|
-
if (commandName === 'model image-models' || commandName === 'model video-models') return formatPrettyModelList(commandName, data, context);
|
|
2951
|
+
if (commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models') return formatPrettyModelList(commandName, data, context);
|
|
2933
2952
|
if (commandName === 'model options') return formatPrettyModelOptions(data, context);
|
|
2934
2953
|
if (commandName === 'model create-spec') return formatPrettyModelCreateSpec(data, context);
|
|
2935
2954
|
if (commandName === 'model input-guide') return formatPrettyModelInputGuide(data, context);
|
|
@@ -3032,7 +3051,7 @@ export function formatTextOutput(commandName, data, context = {}) {
|
|
|
3032
3051
|
if (!isPlainObject(normalized)) return `ok ${commandName}\nvalue=${shortValue(normalized)}\n`;
|
|
3033
3052
|
const lines = [`ok ${commandName}`];
|
|
3034
3053
|
const list = firstList(normalized);
|
|
3035
|
-
const isModelList = commandName === 'model image-models' || commandName === 'model video-models';
|
|
3054
|
+
const isModelList = commandName === 'model image-models' || commandName === 'model video-models' || commandName === 'model audio-models';
|
|
3036
3055
|
const scalarLine = renderRecord(
|
|
3037
3056
|
normalized,
|
|
3038
3057
|
[
|