better recap prompts by doing an intro with the OP

main
Bel LaPointe 2024-04-19 14:01:24 -06:00
parent f27d416a5a
commit 5785ea37ae
2 changed files with 12 additions and 4 deletions

View File

@ -25,6 +25,7 @@ type Config struct {
FillWithTestdata bool
OllamaUrl string
OllamaModel string
RecapPromptIntro string
RecapPrompt string
AssetPattern string
DatacenterPattern string
@ -55,7 +56,8 @@ func newConfigFromEnv(ctx context.Context, getEnv func(string) string) (Config,
AssetPattern: renderAssetPattern,
DatacenterPattern: renderDatacenterPattern,
EventNamePattern: renderEventNamePattern,
RecapPrompt: "Summarize the Slack thread in 1 sentence. List any suggested follow ups.",
RecapPromptIntro: "A Slack thread begin with the following original post.",
RecapPrompt: "Summarize all of the following Slack thread responses in 1 sentence without any leading text.",
}
var m map[string]any

View File

@ -49,9 +49,15 @@ func newPersistenceToRecapProcess(cfg Config) processFunc {
continue
}
prompt := []string{cfg.RecapPrompt}
prompt = append(prompt, "---")
for _, message := range messages {
prompt := []string{
cfg.RecapPromptIntro,
"---",
messages[0].Plaintext,
"---",
cfg.RecapPrompt,
"---",
}
for _, message := range messages[1:] {
prompt = append(prompt, fmt.Sprintf("%s\n%s", message.Author, message.Plaintext))
}