fix
This commit is contained in:
@@ -24,18 +24,23 @@ func resolveProductPromptTemplates(in ProductInput) (systemTpl, userTpl string)
|
||||
userTpl = def.UserTemplate
|
||||
}
|
||||
}
|
||||
// Prefer stored description_template; else derive HTML sections from the
|
||||
// category prompt Description role (A1-style <H2>{…}</H2> overlays).
|
||||
descTpl := aiprompts.EffectiveDescriptionTemplateAny(in.DescriptionTemplate, catPrompt)
|
||||
// Category formulas are language-agnostic; inject once into the shared user skeleton.
|
||||
userTpl = AppendFormulaConstraints(userTpl, in.TitleTemplate, in.DescriptionTemplate, in.OmitSEOMeta)
|
||||
userTpl = AppendFormulaConstraints(userTpl, in.TitleTemplate, descTpl, in.OmitSEOMeta)
|
||||
// Category attribute allowlist + title-formula keys guide JSON "attrs" extraction.
|
||||
allowed := enhanceAllowedAttrKeys(in, in.CategoryUniqueID)
|
||||
userTpl = AppendAttributeConstraints(userTpl, allowed, in.TitleTemplate)
|
||||
// Company/built-in system prompts often say "1-2 sentences"; when a category
|
||||
// description formula exists, override that so process matches A1 category defs.
|
||||
systemTpl = AppendDescriptionFormulaSystemOverride(systemTpl, in.DescriptionTemplate)
|
||||
systemTpl = AppendDescriptionFormulaSystemOverride(systemTpl, descTpl)
|
||||
// Same for title_template vs "short retail title" — formulas win for name structure.
|
||||
systemTpl = AppendTitleFormulaSystemOverride(systemTpl, in.TitleTemplate)
|
||||
// Free-form Title section (prompt UI) that asks for a rewrite — not title_template.
|
||||
systemTpl = AppendTitlePromptRewriteOverride(systemTpl, catPrompt)
|
||||
if !in.OmitSEOMeta {
|
||||
systemTpl = AppendMetaFormulaSystemOverride(systemTpl, in.DescriptionTemplate)
|
||||
systemTpl = AppendMetaFormulaSystemOverride(systemTpl, descTpl)
|
||||
}
|
||||
// categories.prompt applies to name, description, and attrs (not description-only).
|
||||
systemTpl = AppendCategoryEnhanceSystemOverlay(systemTpl, catPrompt)
|
||||
|
||||
Reference in New Issue
Block a user