refactor(vision): #2201 代码精简 — 删lite/pro竞速/#2194临时止血/V1V2双分支 #2201
Reference in New Issue
Block a user
Delete Branch "refactor/vision-v2-clean"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
按灵应补充要求清理冗余代码:上专用API架构后,VLM一把梭时代的竞速/超时/重试/fallback/GET+Range检查等临时方案该删就删,不要两套逻辑并存。
清理内容
_analyze_single_image整个函数(450行 lite/pro 竞速 + 复杂 _xml_to_product 解析 + _normalize 多分支),VLM兜底抽到vision/vlm_fallback.py,只保留单次pro调用+简化版XML/JSON解析_is_vision_result_usable函数、ThreadPoolExecutor/as_completed在 viral_video.py 的 import代码量变化
viral_video.py:2583行 → 2031行(净删 552 行)vision/模块:6 个文件共 873 行(职责清晰,vlm_fast_json=141行、ocr_volc=108行、assembler=297行、vlm_fallback=197行、fast_path=127行)架构
🚀 预览环境已部署
9ee1c50520toae2ddc2af2ae2ddc2af2toed24c7cd68🗑️ 预览环境已清理
PR #2201 已关闭或合并,对应的预览环境已被清理。