feat: add timestamped prompt file generation for summarization

This commit is contained in:
Olivier Tremblay 2025-11-10 18:58:13 -05:00 committed by Olivier Tremblay (aider)
parent b151515a56
commit e640db11e7

View file

@ -7,6 +7,7 @@ import (
"io" "io"
"net/http" "net/http"
"os" "os"
"time"
"o5r.ca/autocrossbow/contributions" "o5r.ca/autocrossbow/contributions"
"o5r.ca/autocrossbow/issues" "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 += fmt.Sprintf("Description: %s\n", issue.Description)
fullPrompt += "--------\n" 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 // Get OpenAI endpoint and token from environment variables
openaiEndpoint := os.Getenv("OPENAI_ENDPOINT") openaiEndpoint := os.Getenv("OPENAI_ENDPOINT")
openaiToken := os.Getenv("OPENAI_TOKEN") openaiToken := os.Getenv("OPENAI_TOKEN")