feat: add file prompt support with fallback to literal prompt string

Co-authored-by: aider (openai/qwen3-coder:30b-a3b-q4_K_M) <aider@aider.chat>
This commit is contained in:
Olivier Tremblay 2025-11-14 07:15:05 -05:00
parent 2ae52d1530
commit 703f4bbdda

View file

@ -38,6 +38,18 @@ func main() {
os.Exit(1)
}
// Check if the prompt is a file path and read it if it exists
finalPrompt := *prompt
if _, err := os.Stat(*prompt); err == nil {
// File exists, read it
content, err := os.ReadFile(*prompt)
if err != nil {
fmt.Printf("Error reading prompt file: %v\n", err)
os.Exit(1)
}
finalPrompt = string(content)
}
var prs map[string][]contributions.PullRequest
var issues []issues.Issue
var vikunjaTasks []vikunja.Task
@ -66,7 +78,7 @@ func main() {
os.Exit(1)
}
summ, err := SummarizeData(*employeename, prs, issues, vikunjaTasks, *prompt, openaiEndpoint, openaiToken, openaiModel)
summ, err := SummarizeData(*employeename, prs, issues, vikunjaTasks, finalPrompt, openaiEndpoint, openaiToken, openaiModel)
if err != nil {
fmt.Println(fmt.Errorf("error getting PRs: %w", err))
os.Exit(1)