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:
parent
2ae52d1530
commit
703f4bbdda
1 changed files with 13 additions and 1 deletions
|
|
@ -38,6 +38,18 @@ func main() {
|
||||||
os.Exit(1)
|
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 prs map[string][]contributions.PullRequest
|
||||||
var issues []issues.Issue
|
var issues []issues.Issue
|
||||||
var vikunjaTasks []vikunja.Task
|
var vikunjaTasks []vikunja.Task
|
||||||
|
|
@ -66,7 +78,7 @@ func main() {
|
||||||
os.Exit(1)
|
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 {
|
if err != nil {
|
||||||
fmt.Println(fmt.Errorf("error getting PRs: %w", err))
|
fmt.Println(fmt.Errorf("error getting PRs: %w", err))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue