fix
This commit is contained in:
@@ -663,7 +663,19 @@ func (h HeuristicCompleter) Complete(_ context.Context, system, user string) (Co
|
||||
if desc == "" || descriptionEchoesTitle(desc, name) || isWeakPriorEnhanceDescription(desc, name) {
|
||||
desc = inventHeuristicDescription(system, user, name)
|
||||
}
|
||||
b, _ := json.Marshal(map[string]string{"name": name, "description": desc})
|
||||
payload := map[string]any{"name": name, "description": desc}
|
||||
if strings.Contains(systemL, "meta_title") {
|
||||
payload["meta_title"] = truncateRunes(name, 60)
|
||||
payload["meta_description"] = truncateRunes(stripMetaTags(desc), 155)
|
||||
}
|
||||
if strings.Contains(systemL, `"attrs"`) {
|
||||
if attrs := CompactAttrs(parseAttrsFromPrompt(user), MaxAttrKeys); len(attrs) > 0 {
|
||||
payload["attrs"] = attrs
|
||||
} else {
|
||||
payload["attrs"] = map[string]any{}
|
||||
}
|
||||
}
|
||||
b, _ := json.Marshal(payload)
|
||||
text = string(b)
|
||||
case strings.Contains(systemL, "attributes") && strings.Contains(systemL, "json"):
|
||||
text = `{"material":"unknown","brand":"unknown"}`
|
||||
|
||||
Reference in New Issue
Block a user