From e640db11e782add1c410d717628c79574812bcfc Mon Sep 17 00:00:00 2001 From: Olivier Tremblay Date: Mon, 10 Nov 2025 18:58:13 -0500 Subject: [PATCH] feat: add timestamped prompt file generation for summarization --- cmd/acb/summarize.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/acb/summarize.go b/cmd/acb/summarize.go index 10bb8ea..5b1d46a 100644 --- a/cmd/acb/summarize.go +++ b/cmd/acb/summarize.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "os" + "time" "o5r.ca/autocrossbow/contributions" "o5r.ca/autocrossbow/issues" @@ -35,7 +36,13 @@ func SummarizeData(employeename string, prs map[string][]contributions.PullReque fullPrompt += fmt.Sprintf("Description: %s\n", issue.Description) fullPrompt += "--------\n" } - + promptf, err := os.Create(fmt.Sprintf("prompt-%s-%d.json", employeename, time.Now().Unix())) + if err != nil { + fmt.Println(fmt.Errorf("error creating PR file: %w", err)) + os.Exit(1) + } + promptf.WriteString(fullPrompt) + defer promptf.Close() // Get OpenAI endpoint and token from environment variables openaiEndpoint := os.Getenv("OPENAI_ENDPOINT") openaiToken := os.Getenv("OPENAI_TOKEN")