完成视频复刻和优化
This commit is contained in:
@@ -170,14 +170,14 @@ def _public_error(raw: str) -> str:
|
||||
text = (raw or "").strip()
|
||||
lower = text.lower()
|
||||
if QUICK_SCRIPT_MODEL_NAME in lower:
|
||||
return "极速成片需要的豆包 Seed 2.1 Pro 模型未启用,请联系管理员配置"
|
||||
return "一键成片需要的豆包 Seed 2.1 Pro 模型未启用,请联系管理员配置"
|
||||
if "insufficient credit" in lower or "额度不足" in text:
|
||||
return "可用积分不足,极速成片已暂停"
|
||||
return "可用积分不足,一键成片已暂停"
|
||||
if "no active" in lower or "not configured" in lower or "没有可用" in text:
|
||||
return "当前缺少可用的生成模型,请联系管理员配置"
|
||||
if _looks_like_review_error(text):
|
||||
return REVIEW_FAIL_MESSAGE
|
||||
return "极速成片暂未完成,请稍后重试或进入专业模式查看"
|
||||
return "一键成片暂未完成,请稍后重试或进入专业模式查看"
|
||||
|
||||
|
||||
def _safe_error(exc: Exception) -> str:
|
||||
@@ -301,7 +301,7 @@ def fail_quick_create(job: QuickCreateJob, message: str, *, internal_error: str
|
||||
job.refresh_from_db(fields=["status", "metadata", "phase"])
|
||||
if job.status in {QuickCreateJob.Status.SUCCEEDED, QuickCreateJob.Status.CANCELLED}:
|
||||
return
|
||||
public_message = (message or "极速成片暂未完成,请稍后重试").strip()[:500]
|
||||
public_message = (message or "一键成片暂未完成,请稍后重试").strip()[:500]
|
||||
metadata = dict(job.metadata or {})
|
||||
if internal_error:
|
||||
metadata["internal_error"] = internal_error[:2000]
|
||||
@@ -365,7 +365,7 @@ def _consume_script_agent(job: QuickCreateJob) -> None:
|
||||
settings = _quick_settings(project)
|
||||
user = job.created_by or project.created_by
|
||||
if user is None:
|
||||
raise ValueError("极速成片任务缺少创建人")
|
||||
raise ValueError("一键成片任务缺少创建人")
|
||||
model_config = get_quick_script_model()
|
||||
if model_config is None:
|
||||
raise ValueError(f"{QUICK_SCRIPT_MODEL_NAME} is not configured")
|
||||
@@ -376,7 +376,8 @@ def _consume_script_agent(job: QuickCreateJob) -> None:
|
||||
getattr(product, "category", "") or "",
|
||||
getattr(product, "title", "") or "",
|
||||
)
|
||||
fmt = wizard.get("presentation_format") or rec["format"]
|
||||
# 极速成片与专业创作一致,脚本表现形式统一为口播。
|
||||
fmt = "oral"
|
||||
structure = wizard.get("video_structure") or rec["structure"]
|
||||
persona = wizard.get("persona") or rec["persona"]
|
||||
format_label = PRESENTATION_FORMATS.get(fmt, fmt)
|
||||
@@ -486,7 +487,7 @@ def _advance_product(job: QuickCreateJob) -> int:
|
||||
ProductSellingPoint.objects.create(
|
||||
product=product,
|
||||
title=product.title,
|
||||
detail="由极速成片根据商品名称自动填写",
|
||||
detail="由一键成片根据商品名称自动填写",
|
||||
sort_order=0,
|
||||
)
|
||||
_save_job(
|
||||
@@ -695,7 +696,7 @@ def _start_base_assets(job: QuickCreateJob) -> None:
|
||||
project = job.project
|
||||
user = job.created_by or project.created_by
|
||||
if user is None:
|
||||
raise ValueError("极速成片任务缺少创建人")
|
||||
raise ValueError("一键成片任务缺少创建人")
|
||||
with transaction.atomic():
|
||||
job = QuickCreateJob.objects.select_for_update().select_related("project").get(id=job.id)
|
||||
metadata = dict(job.metadata or {})
|
||||
@@ -939,7 +940,7 @@ def _start_videos(job: QuickCreateJob) -> None:
|
||||
submit_video_segment(
|
||||
video_segment=segment,
|
||||
user=job.created_by or job.project.created_by,
|
||||
prompt="极速成片自动生成,严格遵循本镜故事板与脚本。",
|
||||
prompt="一键成片自动生成,严格遵循本镜故事板与脚本。",
|
||||
model_config_id=settings["video_model_config_id"] or None,
|
||||
aspect_ratio=settings["aspect_ratio"],
|
||||
resolution=settings["resolution"],
|
||||
|
||||
Reference in New Issue
Block a user