feat: add timestamped prompt file generation for summarization
This commit is contained in:
parent
b151515a56
commit
e640db11e7
1 changed files with 8 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue