fix
This commit is contained in:
@@ -863,6 +863,22 @@ func (e *Engine) enhance(ctx context.Context, in ProductInput, category string,
|
||||
ReasoningEffort: "low",
|
||||
})
|
||||
elapsed := time.Since(started)
|
||||
if obj != nil {
|
||||
applyLegacyEnhanceTagFallback(obj, comp.Text)
|
||||
} else if err != nil && strings.TrimSpace(comp.Text) != "" {
|
||||
// Legacy A1 models sometimes reply with HTML <name>/<metaDescription> instead of JSON.
|
||||
if n, m, body, ok := ParseLegacyEnhanceHTML(comp.Text); ok && (n != "" || body != "") {
|
||||
obj = map[string]any{
|
||||
"name": n,
|
||||
"description": body,
|
||||
"meta_description": m,
|
||||
}
|
||||
if n != "" && m == "" {
|
||||
obj["meta_title"] = n
|
||||
}
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
// Network/provider failure vs parse failure after retry
|
||||
name := preferredProductTitle(in.GTIN, in.Name, in.PriorProcessedName)
|
||||
|
||||
Reference in New Issue
Block a user