Skip to content

Commit

Permalink
prompt: Fix JobList (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshineplan committed Jul 11, 2024
1 parent 476a4d3 commit 7156a27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ func (prompt *Prompt) Execute(ai ai.AI, input []string, prefix string) (<-chan *
return c, n, nil
}

func (prompt *Prompt) JobList(ai ai.AI, input []string, prefix string, c chan<- *Result) (*workers.JobList[*Result], int, error) {
func (prompt *Prompt) JobList(ctx context.Context, ai ai.AI, input []string, prefix string, c chan<- *Result) (
*workers.JobList[*Result], int, error) {
prompts, err := prompt.Prompts(input, prefix)
if err != nil {
return nil, 0, err
Expand All @@ -160,6 +161,7 @@ func (prompt *Prompt) JobList(ai ai.AI, input []string, prefix string, c chan<-
}
c <- r
})
jobList.Start(ctx)
for i, p := range prompts {
jobList.PushBack(&Result{Index: i, Prompt: p})
}
Expand Down

0 comments on commit 7156a27

Please sign in to comment.