v0.1.17: replace persona library with juxtaposed characters, add custom persona support
This commit is contained in:
+12
-9
@@ -191,18 +191,21 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) {
|
||||
}
|
||||
|
||||
// Prepend the persona system prompt to set the bot's character.
|
||||
// Priority: KV override > CustomPersona config > Persona dropdown config
|
||||
// Priority: KV override > dropdown selection
|
||||
// If dropdown = "custom" → use CustomPersona textarea field
|
||||
// Otherwise → resolve from personaLibrary
|
||||
persona := p.GetPersonaOverride(post.UserId, post.ChannelId)
|
||||
persona = resolvePersona(persona)
|
||||
if persona == "" {
|
||||
persona = cfg.CustomPersona
|
||||
}
|
||||
if persona == "" {
|
||||
persona = resolvePersona(cfg.Persona)
|
||||
}
|
||||
// If still empty and the config has a value, use it as-is (legacy fallback).
|
||||
if persona == "" && cfg.Persona != "" {
|
||||
persona = cfg.Persona
|
||||
if cfg.Persona == "custom" {
|
||||
persona = cfg.CustomPersona
|
||||
} else {
|
||||
persona = resolvePersona(cfg.Persona)
|
||||
// If resolvePersona returned empty but a value was set, use it as-is (legacy fallback).
|
||||
if persona == "" && cfg.Persona != "" {
|
||||
persona = cfg.Persona
|
||||
}
|
||||
}
|
||||
}
|
||||
systemPrompt := ""
|
||||
if persona != "" {
|
||||
|
||||
Reference in New Issue
Block a user