feat(product-suite): align reference prompt rules

This commit is contained in:
chengma
2026-07-17 16:03:10 +08:00
parent 35dc010d44
commit 782f1dcdd9
6 changed files with 57 additions and 9 deletions
+8 -5
View File
@@ -265,6 +265,13 @@ def product_suite_prompt_context(
if not item_text or item_text.startswith("draft_"):
item_text = "未绑定商品"
reference_index = max(1, int(source_index or 1))
if normalized["per_image_primary"]:
reference_rule = (
"当前上传图片是本任务唯一主参考图;保持商品主体、款式、颜色和关键细节准确;"
"不编造用户与参考图均未提供的信息。"
)
else:
reference_rule = "使用第一張上傳圖作為主商品圖,其餘圖片只作為參考。"
return {
"生成目标": category_description(category),
"套图名称": str(category or ""),
@@ -275,11 +282,7 @@ def product_suite_prompt_context(
"图片比例": normalized["ratio"],
"商品ID": item_text,
"主参考图序号": str(reference_index),
"参考图规则": (
"参考图规则:当前上传图片是本任务唯一主参考图(序号%d);保持商品主体、"
"款式、颜色和关键细节准确;不编造用户与参考图均未提供的信息。"
% reference_index
),
"参考图规则": reference_rule,
"商品卖点与要求": str(base_prompt or "").strip(),
"尺寸与长图规则": PRODUCT_SUITE_SIZE_RULE,
"禁用内容规则": PRODUCT_SUITE_FORBIDDEN_CONTENT_RULE,