模特库标签分页与全能创作收口:藏长视频、选择器分页

角色库导入打标签并支持筛选;模特库与全能创作角色/商品选择改为每页 20 条分页。临时限制成片 ≤60 秒,过滤对话里的超长时长选项,并收拢本地全能创作与后台用户相关修复。
This commit is contained in:
Azmat@qq.com
2026-09-21 16:24:37 +08:00
parent 690eb3d843
commit 0bd1db6bf9
48 changed files with 3386 additions and 896 deletions
+20 -2
View File
@@ -107,7 +107,13 @@ class VolcanoArkProvider:
stream=True,
timeout=timeout,
) as response:
response.raise_for_status()
if response.status_code >= 400:
# 光有状态码定位不了问题:ARK 的参数校验原因只在响应体里(例如某个
# 字段不被该模型支持)。带上正文再抛,否则每次都只能靠猜。
detail = (response.text or "").strip()[:600]
raise requests.HTTPError(
f"{response.status_code} from {endpoint}: {detail}", response=response
)
# SSE 响应常不带 charset,requests 会按 latin-1 解码 → 中文乱码。强制 UTF-8。
response.encoding = "utf-8"
for raw in response.iter_lines(decode_unicode=True):
@@ -123,6 +129,11 @@ class VolcanoArkProvider:
choices = chunk.get("choices") or []
if not choices:
continue
# finish_reason=length 说明输出撞到 max_tokens 被截断。调用方必须能区分
# 「模型没写」和「写了但被砍掉」,否则坏 JSON 只会被当成模型偷懒反复重试。
finish = choices[0].get("finish_reason")
if finish:
yield {"type": "finish", "reason": str(finish)}
delta = choices[0].get("delta") or {}
# 推理模型(豆包 seed-pro / 部分中转 o系/gemini)思考阶段只发 reasoning_content,
# 不发 content。必须单独转发,否则整个思考期(可达几十秒~分钟)前端零输出 = 假死。
@@ -226,7 +237,14 @@ class VolcanoArkProvider:
"generate_audio": generate_audio,
}
if seed is not None and seed != -1:
body["seed"] = seed
# Seedance 2.5 r2v 硬上限是 int32 正数(2147483647)。文档写 2^32-1,但 r2v 实际更严;
# 超一点整条 InvalidParameter。这里兜住所有上游构造路径。
try:
clamped = int(seed) & 2147483647
except (TypeError, ValueError):
clamped = None
if clamped:
body["seed"] = clamped
if search_mode == "smart":
body["tools"] = [{"type": "web_search"}]
response = requests.post(