feat(ai): test saved summary model generation (#43)

This commit is contained in:
2026-11-25 09:32:05 +01:00
parent 33dcc11aa5
commit a3738de516
27 changed files with 1595 additions and 43 deletions

View File

@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
)
@ -56,9 +55,9 @@ func (p *anthropicProvider) Summarize(ctx context.Context, prompt string, opts G
}
defer resp.Body.Close()
raw, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
return "", &summaryHTTPError{status: resp.StatusCode, err: fmt.Errorf("anthropic API error %d: %s", resp.StatusCode, raw)}
raw, err := readGenerationResponse(resp)
if err != nil {
return "", err
}
var result struct {