From 5785ea37ae8c776f3f3cb128844e360c13e6a5f8 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Fri, 19 Apr 2024 14:01:24 -0600 Subject: [PATCH] better recap prompts by doing an intro with the OP --- config.go | 4 +++- recap.go | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 271922c..279e044 100644 --- a/config.go +++ b/config.go @@ -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 diff --git a/recap.go b/recap.go index c62f3b5..da6d2f4 100644 --- a/recap.go +++ b/recap.go @@ -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)) }