@@ -141,9 +141,35 @@ class CompleteMultiAgent(MultiAgentBase):
141
141
async def invoke_async (self , task : str ) -> MultiAgentResult :
142
142
return MultiAgentResult (results = {})
143
143
144
- def __call__ (self , task : str ) -> MultiAgentResult :
145
- return MultiAgentResult (results = {})
146
-
147
- # Should not raise an exception
144
+ # Should not raise an exception - __call__ is provided by base class
148
145
agent = CompleteMultiAgent ()
149
146
assert isinstance (agent , MultiAgentBase )
147
+
148
+
149
+ def test_multi_agent_base_call_method ():
150
+ """Test that __call__ method properly delegates to invoke_async."""
151
+
152
+ class TestMultiAgent (MultiAgentBase ):
153
+ def __init__ (self ):
154
+ self .invoke_async_called = False
155
+ self .received_task = None
156
+ self .received_kwargs = None
157
+
158
+ async def invoke_async (self , task , ** kwargs ):
159
+ self .invoke_async_called = True
160
+ self .received_task = task
161
+ self .received_kwargs = kwargs
162
+ return MultiAgentResult (
163
+ status = Status .COMPLETED , results = {"test" : NodeResult (result = Exception ("test" ), status = Status .COMPLETED )}
164
+ )
165
+
166
+ agent = TestMultiAgent ()
167
+
168
+ # Test with string task
169
+ result = agent ("test task" , param1 = "value1" , param2 = "value2" )
170
+
171
+ assert agent .invoke_async_called
172
+ assert agent .received_task == "test task"
173
+ assert agent .received_kwargs == {"param1" : "value1" , "param2" : "value2" }
174
+ assert isinstance (result , MultiAgentResult )
175
+ assert result .status == Status .COMPLETED
0 commit comments