Add debug stats
This commit is contained in:
@@ -156,7 +156,7 @@ func (j *Job) Run(ctx context.Context) Result {
|
||||
defer cancel()
|
||||
}
|
||||
|
||||
msgs, err := j.llm.Completions(
|
||||
res, err := j.llm.Completions(
|
||||
ctx,
|
||||
j.model,
|
||||
j.SystemMessage(),
|
||||
@@ -178,7 +178,7 @@ func (j *Job) Run(ctx context.Context) Result {
|
||||
Error: fmt.Errorf("job %q: %w", j.Name(), err),
|
||||
}
|
||||
}
|
||||
if len(msgs) == 0 {
|
||||
if len(res.Messages) == 0 {
|
||||
log.ErrorContext(
|
||||
ctx,
|
||||
"job returned no messages",
|
||||
@@ -197,11 +197,11 @@ func (j *Job) Run(ctx context.Context) Result {
|
||||
ctx,
|
||||
"job completed",
|
||||
slog.Duration("duration", duration),
|
||||
slog.Int("messages", len(msgs)),
|
||||
slog.Int("messages", len(res.Messages)),
|
||||
)
|
||||
return Result{
|
||||
Name: j.Name(),
|
||||
Duration: duration,
|
||||
Messages: msgs,
|
||||
Messages: res.Messages,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user