From 7ff58c488e31f7e1992fe35bdc57722c502b4a51 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 22 May 2026 09:30:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A5=E5=85=A5=E8=B1=86=E5=8C=85=20?= =?UTF-8?q?Seedance=202.0=20Fast=20=E8=A7=86=E9=A2=91=E7=94=9F=E6=88=90=20?= =?UTF-8?q?(=E6=96=87=E7=94=9F=E8=A7=86=E9=A2=91)=20+=20videogen=20skill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tools/seedance.py: 异步 submit /contents/generations/tasks → 5s 轮询 → succeeded 后 download mp4 + meta.json 落 /videos/;失败/cancel 不计费;cancel_check 在 轮询间检查,响应用户停止按钮 - config/media/doubao.yaml: 展开 video.seedance_2_fast (¥37/Mtok 文生 / ¥22/Mtok 图生,token 公式校验 720p 5s = ¥4.00 完全对上源数据) - core/storage/usage.py: record_video_usage,kind=video,units jsonb snapshot resolution/duration/ratio/fps/tokens/单价 - core/agent_builder.py: build_agent 加 video_variant + cancel_check 形参, cancel_check 必须 build 阶段传 (SeedanceTool ctor 持有用于轮询) - web/app.py: GET /v1/video_models + MessageRequest.video_model + 透传 - web/static/dev.html: 顶栏第三下拉 (image 旁边) + state.videoModels/videoModel - skills/videogen/SKILL.md: 六维诊断 (运动+镜头 替代 imagegen 的光线);BLOCKING 门槛比 imagegen 更严 (¥4 vs ¥0.22) + 等 30-90s 出片 - prompts/system/general_v1.md: 加 seedance 触发指引 (平行 seedream) phase 1 仅 t2v 文生视频,fast 上限 720p。API 端到端 smoke 跑过:路径/auth/错误解析 全通,body schema 待用户在火山方舟控制台开通模型后真出片才能验。 Co-Authored-By: Claude Opus 4.7 (1M context) --- PROGRESS.md | 8 +- RUN.md | 5 +- config/media/doubao.yaml | 48 +++-- core/agent_builder.py | 36 +++- core/storage/usage.py | 60 ++++++ prompts/system/general_v1.md | 3 + scripts/smoke_seedance.py | 121 +++++++++++++ skills/videogen/SKILL.md | 243 +++++++++++++++++++++++++ tools/seedance.py | 342 +++++++++++++++++++++++++++++++++++ web/app.py | 104 +++++++++-- web/static/dev.html | 35 ++++ 11 files changed, 974 insertions(+), 31 deletions(-) create mode 100644 scripts/smoke_seedance.py create mode 100644 skills/videogen/SKILL.md create mode 100644 tools/seedance.py diff --git a/PROGRESS.md b/PROGRESS.md index d18393e..922a9a4 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -2,7 +2,7 @@ > 配合 `DESIGN.md`。本文件只记 phase 状态、决策偏差、文件量、下一步。每条 1-2 句:做了啥 + 关键判断;细节查 `git log` / `git diff` / `DESIGN §7.9`。 -最后更新:2026-05-21(sandbox 阻塞地位写进 DESIGN + 黑名单不再加强) +最后更新:2026-05-22(豆包 Seedance 2.0 Fast 视频生成接入 + videogen skill) --- @@ -10,7 +10,7 @@ | Phase | 标题 | 状态 | 备注 | |---|---|---|---| -| 1-3 | 骨架 + Skill + run_python | ✅ | 三个 skill;CoreCoder 唯一匹配 edit;敏感 env 过滤 | +| 1-3 | 骨架 + Skill + run_python | ✅ | 多 skill(coding/proposal/ppt/research/documents/imagegen/videogen);CoreCoder 唯一匹配 edit;敏感 env 过滤 | | 4 | 演化性能力 | 🟡 | Model Profile + Probing ✅;版本化 prompt 未做 | | 5 | Eval Suite | ⏸ 不做 | dogfooding 替代,probe 覆盖健康检查 | | 6 | 长任务工程化 | 🟡 | task + 恢复 ✅;双层记忆 ✅;context 压缩未做 | @@ -21,6 +21,10 @@ ## 已完成关键能力 +### 2026-05-22 + +- **豆包 Seedance 2.0 Fast 视频生成接入(文生视频)+ videogen skill**:`config/media/doubao.yaml` 展开 video 段(`seedance_2_fast`:¥37/Mtok 文生 / ¥22/Mtok 图生,实测档位 480p 5s ¥1.86 / 720p 5s ¥4.00 — 由 token 公式 `(in+out)×W×H×fps/1024` 反推校验通过);`tools/seedance.py` 走 ark POST `/contents/generations/tasks` → 5s 间隔轮询 → succeeded 后 download mp4 + .meta.json 落 `/videos/-.mp4`,失败/cancel 不计费;`core/storage/usage.py::record_video_usage` 多态 units snapshot(resolution/duration/ratio/fps/tokens/单价);`build_agent` 加 `video_variant` + `cancel_check` 形参 — cancel_check 必须在 build 阶段传(SeedanceTool ctor 持有用于轮询期间响应停止按钮,改了原"build 后赋 agent.cancel_check"的延迟绑定,web 入口同步迁移);`web/app.py` 加 `_list_video_variants` / `_resolve_video_model` / `GET /v1/video_models` / `MessageRequest.video_model` / `OptimizePromptRequest.video_model`;`dev.html` 顶栏第三下拉 + `state.videoModels/videoModel` + 发消息一起 POST。前端 chip / inline `