From b1db22a6ddcbc4a3771923e50dc06aadbe3855dc Mon Sep 17 00:00:00 2001 From: sunshineplan Date: Fri, 12 Jul 2024 08:58:36 +0800 Subject: [PATCH] prompt: Fix JobList Tokens --- prompt/prompt.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prompt/prompt.go b/prompt/prompt.go index ed1966b..14d4880 100644 --- a/prompt/prompt.go +++ b/prompt/prompt.go @@ -154,9 +154,11 @@ func (prompt *Prompt) JobList(ctx context.Context, ai ai.AI, input []string, pre resp, err := chat(ai, prompt.d, r.Prompt) if err != nil { r.Result = nil + r.Tokens = 0 r.Error = err } else { r.Result = resp.Results() + r.Tokens = resp.TokenCount().Total r.Error = nil } c <- r