X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/c781f79f3c8cb9a7577ee1574d196988da2719b3..4a42f7f208cbfead335eba9ebe615b35b1742130:/compactor.go?ds=sidebyside diff --git a/compactor.go b/compactor.go index 6738955..64ff1fd 100644 --- a/compactor.go +++ b/compactor.go @@ -56,12 +56,12 @@ func newCompactor(client *ModelClient, instructions func() (string, error), mode func (c *Compactor) Summarize(ctx context.Context, task Task) (string, error) { text, err := compactorTask(task) if err != nil { - return "", err + return "", fmt.Errorf("prepare compaction task: %w", err) } instructions, err := c.instructions() if err != nil { - return "", err + return "", fmt.Errorf("read compaction instructions: %w", err) } source := task.Context + "\n" + text @@ -110,7 +110,7 @@ func (c *Compactor) Summarize(ctx context.Context, task Task) (string, error) { } if len(lines) == 0 { - return "", err + return "", fmt.Errorf("summarize node: %w", err) } return compactorShortest(lines), nil