Skip to content

Commit

Permalink
fix: add ut of react agent for testing messages modifier (#57)
Browse files Browse the repository at this point in the history
fix: add ut of react agent for test messages modifier
  • Loading branch information
meguminnnnnnnnn authored Feb 7, 2025
1 parent 3b806ca commit 8a2f8a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions flow/agent/react/react_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ func TestReact(t *testing.T) {
ToolsConfig: compose.ToolsNodeConfig{
Tools: []tool.BaseTool{fakeTool},
},

MessageModifier: func(ctx context.Context, input []*schema.Message) []*schema.Message {
assert.Equal(t, len(input), times*2+1)
return input
},
MaxStep: 40,
})
assert.Nil(t, err)
Expand All @@ -106,7 +109,10 @@ func TestReact(t *testing.T) {
ToolsConfig: compose.ToolsNodeConfig{
Tools: []tool.BaseTool{fakeTool},
},

MessageModifier: func(ctx context.Context, input []*schema.Message) []*schema.Message {
assert.Equal(t, len(input), times*2+1)
return input
},
MaxStep: 40,
ToolReturnDirectly: map[string]struct{}{info.Name: {}},
})
Expand Down

0 comments on commit 8a2f8a8

Please sign in to comment.