Skip to content

Commit 28b4926

Browse files
fix lint
1 parent 9331162 commit 28b4926

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

llms/anthropic/anthropic.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,15 @@ func (p *Anthropic) adaptRequest(_ internal.Adapter, requester llmberjack.Reques
291291
var toolContent string
292292
for _, part := range msg.Parts {
293293
if seeker, ok := part.(io.ReadSeeker); ok {
294-
seeker.Seek(0, io.SeekStart)
294+
_, err := seeker.Seek(0, io.SeekStart)
295+
if err != nil {
296+
return nil, nil, errors.Wrap(err, "could not seek content part")
297+
}
298+
}
299+
buf, err := io.ReadAll(part)
300+
if err != nil {
301+
return nil, nil, errors.Wrap(err, "could not read content part")
295302
}
296-
buf, _ := io.ReadAll(part)
297303
toolContent = string(buf)
298304
}
299305

response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package llmberjack
22

33
import (
44
"encoding/json"
5+
"fmt"
56
"iter"
67
"time"
78

@@ -120,6 +121,7 @@ func (r Response[T]) Get(idx int) (T, error) {
120121
default:
121122
output := new(T)
122123

124+
fmt.Printf("Candidate text: %s\n", candidate.Text)
123125
if err := json.Unmarshal([]byte(candidate.Text), output); err != nil {
124126
return *output, errors.Wrap(err, "failed to decode response to schema")
125127
}

0 commit comments

Comments
 (0)