From 9a71cf44bc4d4dff2b8a1b77a3bcb5ce0ccf6530 Mon Sep 17 00:00:00 2001 From: Olivier Tremblay Date: Tue, 25 Nov 2025 12:45:50 -0500 Subject: [PATCH] fix: correct client reference and update Anthropic summarizer implementation --- cmd/acb/summarize.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/cmd/acb/summarize.go b/cmd/acb/summarize.go index eeab02a..d855718 100644 --- a/cmd/acb/summarize.go +++ b/cmd/acb/summarize.go @@ -129,7 +129,7 @@ func NewAnthropicSummarizer(model string) *AnthropicSummarizer { ) return &AnthropicSummarizer{ - client: client, + client: &client, model: model, } } @@ -143,27 +143,19 @@ func (a *AnthropicSummarizer) Summarize(fullPrompt string) (string, error) { // Create the request ctx := context.Background() - + message, err := a.client.Messages.New(ctx, anthropic.MessageNewParams{ - Model: a.model, - MaxTokens: 1024, + Model: anthropic.Model(a.model), + MaxTokens: 10000, Messages: []anthropic.MessageParam{ anthropic.NewUserMessage(anthropic.NewTextBlock(fullPrompt)), }, }) if err != nil { - return "", err + return "Blew up here", err } - // Extract the response text - var result string - for _, content := range message.Content { - if textBlock, ok := content.AsAny().(*anthropic.TextBlock); ok { - result += textBlock.Text - } - } - - return result, nil + return fmt.Sprintf("%+v\n", message.Content), nil } // buildPrompt constructs the prompt string from PRs, issues, and tasks