feat(viral-video): VLM提速(lite+并行) + 商品描述增强(6维度+summary) + 爆款结构19选注入 #2133

Merged
auto-approve-bot merged 4 commits from feat/viral-vlm-speed-and-rich-analysis into develop 2026-10-02 10:35:25 +08:00
Owner

背景

v7 E2E 测试反馈三个问题:

  1. 单张图片 VLM 分析约 45s 太慢,目标 10-15s
  2. 商品分析结果过于简陋(只返回商品名),竞品返回名称/规格/外观/包装/文字/场景/人群+summary 丰富描述
  3. 爆款结构下拉扩展到 19 个,后端编导 prompt 需要根据用户选择编排文案结构

问题4:图片分析提速

  • 新增 doubao_vision_lite_model(默认 doubao-1-5-vision-lite-250915)+ doubao_vision_use_lite(默认 true)配置项
  • call_vision 支持 model/max_tokens/temperature/timeout/system_prompt 参数覆盖
  • _step_image_analysis 改为 ThreadPoolExecutor 并行调用 VLM(max_workers=min(4,n_images)),lite 模型 timeout=30s,max_tokens=1024
  • 图片直接传公网 OSS URL(无本地下载-上传串行)

问题5:VLM 商品描述增强

  • 新 _IMAGE_ANALYSIS_SYSTEM_PROMPT 要求输出 16 字段:name/brand/category/spec/appearance(80-150字)/packaging(80-150字)/text_on_package(数组)/colors/material_or_texture/key_features/visual_style/scene/suitable_scenes/target_audience/selling_points/summary(150-250字)
  • 严禁编造:看不清/包装上没有统一填「无法判断」,text_on_package 只 OCR 清晰可见的文字
  • summary 字段整合成一段流畅中文导购描述,前端直接展示
  • _build_products_summary 优先用 VLM 的 summary 段(自然段落给编导模型),兜底再拼结构化字段
  • _analyze_single_image 独立函数,所有新字段都有 setdefault 防御,兼容旧字段名

问题6:爆款结构注入

  • 后端 schema 已有 viral_structure 字段,前端已传,本次注入 _SCRIPT_GENERATION_PROMPT
  • prompt 新增「爆款结构」字段+关键要求第8条:严格按结构节奏/段落顺序编排镜头台词
  • 前端 STRUCTURES 从 4 个扩展到 19 个(协调 Agent 提供的中文列表)

其它

  • .env.example 补 DOUBAO_VISION_MODEL/LITE_MODEL/USE_LITE
  • scripts/render_env.sh 新变量加入 SHARED_SECRETS 白名单

验收目标

  • 单图分析 10-15s(lite 模型+并行,从原 45s 显著提速)
  • VLM 返回名称+规格+外观+包装+文字+场景+人群+summary 丰富描述
  • copy_structure 透传影响文案结构
  • CI 全绿后合入 develop,watchtower 自动部署 staging
## 背景 v7 E2E 测试反馈三个问题: 1. 单张图片 VLM 分析约 45s 太慢,目标 10-15s 2. 商品分析结果过于简陋(只返回商品名),竞品返回名称/规格/外观/包装/文字/场景/人群+summary 丰富描述 3. 爆款结构下拉扩展到 19 个,后端编导 prompt 需要根据用户选择编排文案结构 ## 问题4:图片分析提速 - 新增 `doubao_vision_lite_model`(默认 `doubao-1-5-vision-lite-250915`)+ `doubao_vision_use_lite`(默认 true)配置项 - `call_vision` 支持 model/max_tokens/temperature/timeout/system_prompt 参数覆盖 - `_step_image_analysis` 改为 `ThreadPoolExecutor` 并行调用 VLM(max_workers=min(4,n_images)),lite 模型 timeout=30s,max_tokens=1024 - 图片直接传公网 OSS URL(无本地下载-上传串行) ## 问题5:VLM 商品描述增强 - 新 `_IMAGE_ANALYSIS_SYSTEM_PROMPT` 要求输出 16 字段:name/brand/category/spec/appearance(80-150字)/packaging(80-150字)/text_on_package(数组)/colors/material_or_texture/key_features/visual_style/scene/suitable_scenes/target_audience/selling_points/summary(150-250字) - 严禁编造:看不清/包装上没有统一填「无法判断」,text_on_package 只 OCR 清晰可见的文字 - summary 字段整合成一段流畅中文导购描述,前端直接展示 - `_build_products_summary` 优先用 VLM 的 summary 段(自然段落给编导模型),兜底再拼结构化字段 - `_analyze_single_image` 独立函数,所有新字段都有 setdefault 防御,兼容旧字段名 ## 问题6:爆款结构注入 - 后端 schema 已有 viral_structure 字段,前端已传,本次注入 `_SCRIPT_GENERATION_PROMPT` - prompt 新增「爆款结构」字段+关键要求第8条:严格按结构节奏/段落顺序编排镜头台词 - 前端 STRUCTURES 从 4 个扩展到 19 个(协调 Agent 提供的中文列表) ## 其它 - .env.example 补 DOUBAO_VISION_MODEL/LITE_MODEL/USE_LITE - scripts/render_env.sh 新变量加入 SHARED_SECRETS 白名单 ## 验收目标 - 单图分析 10-15s(lite 模型+并行,从原 45s 显著提速) - VLM 返回名称+规格+外观+包装+文字+场景+人群+summary 丰富描述 - copy_structure 透传影响文案结构 - CI 全绿后合入 develop,watchtower 自动部署 staging
xiaoxia added 1 commit 2026-10-02 09:55:03 +08:00
feat(viral-video): VLM提速+商品描述增强+爆款结构注入(问题4/5/6)
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m4s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m17s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 3m55s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m9s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 4m21s
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
0cf7f14992
问题4:图片分析提速
- 新增 doubao_vision_lite_model 配置(默认 doubao-1-5-vision-lite-250915)+ doubao_vision_use_lite 开关
- call_vision 支持 model/max_tokens/temperature/timeout/system_prompt 参数覆盖
- _step_image_analysis 改 ThreadPoolExecutor 并行调用 VLM(max_workers=min(4,n_images)),lite 模型 timeout=30s,max_tokens=1024
- 图片直接传公网 OSS URL 给豆包视觉,无需本地下载-上传链路(原流程已是直传,保持)

问题5:VLM 商品描述增强(对齐竞品截图2粒度)
- 新 _IMAGE_ANALYSIS_SYSTEM_PROMPT 要求输出 16 个字段:name/brand/category/spec/appearance/packaging/text_on_package/colors/material_or_texture/key_features/visual_style/scene/suitable_scenes/target_audience/selling_points/summary
- appearance(外观80-150字)+packaging(包装80-150字)要求自然语言细节描述,summary(150-250字)直接给前端展示
- 严禁编造:看不清/没有的统一填「无法判断」,text_on_package 只 OCR 清晰可见的
- _build_products_summary 优先用 VLM 返回的 summary 段(自然段落给编导模型效果最好),兜底再拼结构化字段
- _analyze_single_image 独立函数,所有新字段都有 setdefault 防御,兼容旧字段名

问题6:爆款结构(copy_structure → viral_structure)透传
- 后端现有 schema 已支持 viral_structure 字段,STEP2 generate-copy 也已传,本次把 viral_structure 注入 _SCRIPT_GENERATION_PROMPT
- prompt 新增「爆款结构」字段+关键要求第8条:必须严格按该结构节奏/段落顺序编排镜头台词
- 前端 STRUCTURES 从 4 个扩展到 19 个(按协调 Agent 提供的中文列表)
- 一键路径 generateViralVideo 已传 viral_structure,无需改动

其它:
- .env.example 补 DOUBAO_VISION_MODEL/LITE_MODEL/USE_LITE 三个配置项
- scripts/render_env.sh 把新变量加入 SHARED_SECRETS 白名单

验收:单图分析目标 10-15s(lite 模型+并行),VLM 返回 6 维度丰富描述+summary,copy_structure 影响文案结构
auto-approve-bot added 1 commit 2026-10-02 09:59:51 +08:00
style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 15s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 13s
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
de72ad9a80
xiaoxia added 1 commit 2026-10-02 10:02:37 +08:00
fix(tests): 补 ThreadPoolExecutor import + 更新测试 mock 适配新配置字段/_pg_url
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 4s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 59s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m5s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m9s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m24s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m52s
AI Code Review / AI Code Review (pull_request) Successful in 7m24s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Failing after 11m31s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m25s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m46s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 2m25s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 3m0s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 10m48s
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
64b3c2707e

🚀 预览环境已部署

项目 详情
PR号 #2133
预览链接 https://pr-2133.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #2133 | | 预览链接 | [https://pr-2133.preview.xiaoxiajianji.com](https://pr-2133.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
xiaoxia added 1 commit 2026-10-02 10:21:22 +08:00
fix(worker): 补 _step_image_analysis 中缺失的 get_shared_settings import(ruff F821)
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m21s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m50s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 2m0s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 54s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m26s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m36s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m36s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m14s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 4m20s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m48s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 5m20s
AI Code Review / AI Code Review (pull_request) Successful in 6m51s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 11m56s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 3s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 11m1s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 34s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 36s
3161fae796
auto-approve-bot merged commit 6b75eb5f67 into develop 2026-10-02 10:35:25 +08:00
auto-approve-bot deleted branch feat/viral-vlm-speed-and-rich-analysis 2026-10-02 10:35:41 +08:00

🗑️ 预览环境已清理

PR #2133 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #2133 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.