X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/a3b9849a54a6cd8a4cc5b1ae03a39aab31322f7b..522d7fd117285e4e4ce3ea5ec9b5a1722521b681:/probe.go?ds=inline diff --git a/probe.go b/probe.go index 69d81d1..f5553ce 100644 --- a/probe.go +++ b/probe.go @@ -98,6 +98,7 @@ func probe(ctx context.Context, args []string, out io.Writer) (err error) { usagePath := filepath.Join(root, "usage.jsonl") client := newModelClient(address, auth, "onechat-"+probeName, usagePath) client.LimitCalls(buildCallLimit) + summarizer := ProbeSlotSummarizer{ inner: newCompactor(client, probePrompt, config.Compactor), slots: make(chan struct{}, builds), @@ -180,8 +181,10 @@ func probeReadLog(path string, count int) (entries []DatedMessage, err error) { scanner := bufio.NewScanner(file) scanner.Buffer(make([]byte, 64*1024), buildLineBytes) + for len(entries) < count && scanner.Scan() { var entry DatedMessage + err = json.Unmarshal(scanner.Bytes(), &entry) if err != nil { return nil, fmt.Errorf("probe log line %d: %w", len(entries)+1, err)