This commit is contained in:
greeneclipse committed 2026-11-11 20:24:59 +01:00
1 parent eefb7e2b75
commit 41f1a7dbe4
2 files changed
+58 -2

No files matched your search

+20 -2
View File
@@ -26,7 +26,7 @@ func resolveProductPromptTemplates(in ProductInput) (systemTpl, userTpl string)
}
allowed := enhanceAllowedAttrKeys(in, in.CategoryUniqueID)
userTpl = AppendAttributeConstraints(userTpl, allowed, in.TitleTemplate)
return systemTpl, userTpl
return AppendDescriptionRichnessOverride(systemTpl), userTpl
}
// Per-category prompt wins for the user message (company system keeps JSON schema / brand).
@@ -61,7 +61,25 @@ func resolveProductPromptTemplates(in ProductInput) (systemTpl, userTpl string)
}
// categories.prompt applies to name, description, and attrs (not description-only).
systemTpl = AppendCategoryEnhanceSystemOverlay(systemTpl, catPrompt)
return systemTpl, userTpl
return AppendDescriptionRichnessOverride(systemTpl), userTpl
}
// descriptionRichnessOverride is a platform-wide rule layered on top of every
// category prompt, so tenants keep their own prompts yet get fuller copy. Category
// prompts usually state modest word ranges and "shorter when sparse"; without this
// the model stops at the bottom of those ranges even when the source is rich.
const descriptionRichnessOverride = `Description depth (platform rule, applies on top of the Description formula): treat every word range in the formula as a minimum to reach whenever the input supports it, and aim for the upper end of it or more. Use ALL verified facts present in Name, Description and Attrs — every feature, technology, capability, connectivity, dimension, certification and warranty detail — and for each one explain what it means for the buyer in complete, developed sentences instead of a one-line summary. Fill every heading/paragraph pair the formula allows; when the supplied Description is rich, write full paragraphs, not a condensed recap, and never drop a supplied fact. Do not invent: any fact, number, percentage or specification must appear literally in the input. When the input is sparse, keep the text short rather than padding or guessing.`
// AppendDescriptionRichnessOverride appends descriptionRichnessOverride once.
func AppendDescriptionRichnessOverride(systemTpl string) string {
systemTpl = strings.TrimSpace(systemTpl)
if strings.Contains(systemTpl, "Description depth (platform rule") {
return systemTpl
}
if systemTpl == "" {
return descriptionRichnessOverride
}
return systemTpl + "\n" + descriptionRichnessOverride
}
// withDefaultCategoryFormula supplies the platform-default formula when the