fix
This commit is contained in:
1 parent
8b540d22bc
commit
c92ee93482
24 files changed
+1495
-327
No files matched your search
@@ -8,6 +8,25 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// This frozen v6 snapshot is used ONLY to identify exact old default templates
|
||||
// during migrations. Never serve these obsolete instructions to new categories.
|
||||
//
|
||||
//go:embed defaults/prompt-rules-v6.json
|
||||
var previousOfflinePromptRulesJSON []byte
|
||||
|
||||
func PreviousOfflineDefaultPromptV6(lang string) (string, error) {
|
||||
var rules map[string]offlineRules
|
||||
if err := json.Unmarshal(previousOfflinePromptRulesJSON, &rules); err != nil {
|
||||
return "", err
|
||||
}
|
||||
rule, ok := rules[lang]
|
||||
if !ok || rule.Title == "" || rule.Description == "" || rule.Meta == "" {
|
||||
return "", fmt.Errorf("missing historical v6 language %q", lang)
|
||||
}
|
||||
return "--- Title ---\n" + rule.Title + "\n--- End Title ---\n\n--- Description ---\n" + rule.Description +
|
||||
"\n--- End Description ---\n\n--- Meta ---\n" + rule.Meta + "\n--- End Meta ---", nil
|
||||
}
|
||||
|
||||
// Shipped, human-readable platform instructions for every supported content
|
||||
// language. This is offline reference data, not a request to an LLM.
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user