Enha: charlist in cards

This commit is contained in:
Grail Finder
2026-01-21 21:01:01 +03:00
parent 4e597e944e
commit a28e8ef9e2
5 changed files with 38 additions and 14 deletions

View File

@@ -31,18 +31,20 @@ func (c *CharCardSpec) Simplify(userName, fpath string) *CharCard {
fm := strings.ReplaceAll(strings.ReplaceAll(c.FirstMes, "{{char}}", c.Name), "{{user}}", userName)
sysPr := strings.ReplaceAll(strings.ReplaceAll(c.Description, "{{char}}", c.Name), "{{user}}", userName)
return &CharCard{
SysPrompt: sysPr,
FirstMsg: fm,
Role: c.Name,
FilePath: fpath,
SysPrompt: sysPr,
FirstMsg: fm,
Role: c.Name,
FilePath: fpath,
Characters: []string{c.Name, userName},
}
}
type CharCard struct {
SysPrompt string `json:"sys_prompt"`
FirstMsg string `json:"first_msg"`
Role string `json:"role"`
FilePath string `json:"filepath"`
SysPrompt string `json:"sys_prompt"`
FirstMsg string `json:"first_msg"`
Role string `json:"role"`
Characters []string `json:"chars"`
FilePath string `json:"filepath"`
}
func (cc *CharCard) ToSpec(userName string) *CharCardSpec {