Per-crow banter voice system: three-layer prompt (memory, voice, line)

This commit is contained in:
Smokey committed 2026-10-27 23:07:33 -06:00
1 parent 017d11cd99
commit fbf9fe67a6
6 files changed
+235 -3

No files matched your search

+9 -2
View File
@@ -165,17 +165,24 @@ func (c *chatter) moment(ctx context.Context, itemID, subject, speaker, what str
defer c.wg.Done()
bctx, cancel := context.WithTimeout(context.WithoutCancel(ctx), 30*time.Second)
defer cancel()
system := systemFor(speaker, markerBanter+` for a crow in a team chat room.
var system string
parse := cleanBanter
if v, ok := voices[speaker]; ok {
p, _ := personaOf(speaker)
system, parse = voicedBanterSystem(p, v), parseVoiced
} else {
system = systemFor(speaker, markerBanter+` for a crow in a team chat room.
Write exactly one line, at most 25 words, in this crow's voice.
Good-natured and PG. Tease other crows if it fits; never mock the human or their task.
Use only the lore provided: do not invent new backstory, names or events.
No emoji, no hashtags, no quotation marks around the line, no name prefix.`, false)
}
prompt := fmt.Sprintf("LORE:\n- %s\n\nMOMENT: %s\n\nWrite %s's line, addressed to %s.", strings.Join(lore, "\n- "), what, speaker, subject)
text, err := c.f.ask(bctx, nil, speaker, system, prompt, c.budget)
if err != nil {
return
}
line, ok := cleanBanter(text, speaker)
line, ok := parse(text, speaker)
if !ok {
return
}