Skip to content

Commit 8a2f8a8

Browse files
fix: add ut of react agent for testing messages modifier (#57)
fix: add ut of react agent for test messages modifier
1 parent 3b806ca commit 8a2f8a8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

flow/agent/react/react_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ func TestReact(t *testing.T) {
8282
ToolsConfig: compose.ToolsNodeConfig{
8383
Tools: []tool.BaseTool{fakeTool},
8484
},
85-
85+
MessageModifier: func(ctx context.Context, input []*schema.Message) []*schema.Message {
86+
assert.Equal(t, len(input), times*2+1)
87+
return input
88+
},
8689
MaxStep: 40,
8790
})
8891
assert.Nil(t, err)
@@ -106,7 +109,10 @@ func TestReact(t *testing.T) {
106109
ToolsConfig: compose.ToolsNodeConfig{
107110
Tools: []tool.BaseTool{fakeTool},
108111
},
109-
112+
MessageModifier: func(ctx context.Context, input []*schema.Message) []*schema.Message {
113+
assert.Equal(t, len(input), times*2+1)
114+
return input
115+
},
110116
MaxStep: 40,
111117
ToolReturnDirectly: map[string]struct{}{info.Name: {}},
112118
})

0 commit comments

Comments
 (0)