Skip to content

Commit 40bed58

Browse files
committed
fix: lint errors
1 parent b91d350 commit 40bed58

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

llms/bedrock/bedrockllm.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ func processMessages(messages []llms.MessageContent) ([]bedrockclient.Message, e
184184
case llms.ToolCall:
185185
var arguments map[string]any
186186
if part.FunctionCall != nil {
187-
json.Unmarshal([]byte(part.FunctionCall.Arguments), &arguments)
187+
if err := json.Unmarshal([]byte(part.FunctionCall.Arguments), &arguments); err != nil {
188+
return nil, err
189+
}
188190
}
189191
bedrockMsgs = append(bedrockMsgs, bedrockclient.Message{
190192
Role: m.Role,

llms/bedrock/bedrockllm_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func TestAmazonOutputLegacyAPI(t *testing.T) {
233233
}
234234
}
235235

236-
func TestAmazonStreamingOutputConverseAPI(t *testing.T) {
236+
func TestAmazonStreamingOutputConverseAPI(t *testing.T) { //nolint:funlen
237237
ctx := t.Context()
238238

239239
httprr.SkipIfNoCredentialsAndRecordingMissing(t, "AWS_ACCESS_KEY_ID")
@@ -331,6 +331,8 @@ func TestAmazonStreamingOutputConverseAPI(t *testing.T) {
331331
streamedChunks = append(streamedChunks, chunk.Content)
332332
case streaming.ChunkTypeDone:
333333
isDone = true
334+
default:
335+
// Ignore other chunks in this test
334336
}
335337
return nil
336338
}
@@ -371,7 +373,7 @@ func TestAmazonStreamingOutputConverseAPI(t *testing.T) {
371373
}
372374
}
373375

374-
func TestAmazonStreamingOutputLegacyAPI(t *testing.T) {
376+
func TestAmazonStreamingOutputLegacyAPI(t *testing.T) { //nolint:funlen
375377
ctx := t.Context()
376378

377379
httprr.SkipIfNoCredentialsAndRecordingMissing(t, "AWS_ACCESS_KEY_ID")
@@ -469,6 +471,8 @@ func TestAmazonStreamingOutputLegacyAPI(t *testing.T) {
469471
streamedChunks = append(streamedChunks, chunk.Content)
470472
case streaming.ChunkTypeDone:
471473
isDone = true
474+
default:
475+
// Ignore other chunks in this test
472476
}
473477
return nil
474478
}
@@ -1117,6 +1121,8 @@ func testReasoningWorkflow(
11171121
switch chunk.Type {
11181122
case streaming.ChunkTypeReasoning:
11191123
reasoningChunks = append(reasoningChunks, chunk.ReasoningContent)
1124+
default:
1125+
// Ignore other chunks in this test
11201126
}
11211127
return nil
11221128
}
@@ -1190,6 +1196,8 @@ type calculatorSchema struct {
11901196
}
11911197

11921198
// testToolCallingWorkflow tests the complete tool calling workflow for a given model
1199+
//
1200+
//nolint:funlen
11931201
func testToolCallingWorkflow(
11941202
ctx context.Context,
11951203
t *testing.T,
@@ -1258,6 +1266,8 @@ func testToolCallingWorkflow(
12581266
} else {
12591267
streaming.AppendToolCall(toolCall, resToolCall)
12601268
}
1269+
default:
1270+
// Ignore other chunks in this test
12611271
}
12621272
return nil
12631273
}

0 commit comments

Comments
 (0)