@@ -256,6 +256,7 @@ def call(
256256
257257 while step_count < self .max_steps :
258258 try :
259+ printc (f'agent planner prompt: { self .agent .planner .get_prompt (** prompt_kwargs )} ' )
259260 # Execute one step
260261 output = self .agent .planner .call (
261262 prompt_kwargs = prompt_kwargs ,
@@ -313,7 +314,6 @@ def _tool_execute_sync(
313314 # Handle cases where result is not wrapped in FunctionOutput (e.g., in tests)
314315 if not isinstance (result , FunctionOutput ):
315316 # If it's a direct result from mocks or other sources, wrap it in FunctionOutput
316- from adalflow .core .types import FunctionOutput
317317 if hasattr (result , 'output' ):
318318 # Already has output attribute, use it directly
319319 wrapped_result = FunctionOutput (
@@ -367,6 +367,7 @@ async def acall(
367367
368368 while step_count < self .max_steps :
369369 try :
370+ printc (f'agent planner prompt: { self .agent .planner .get_prompt (** prompt_kwargs )} ' )
370371 # Execute one step asynchronously
371372 output = await self .agent .planner .acall (
372373 prompt_kwargs = prompt_kwargs ,
@@ -405,7 +406,7 @@ async def acall(
405406 self .agent .planner .get_prompt (** prompt_kwargs )
406407 )
407408 )
408- printc ( f'agent planner prompt: { self . agent . planner . get_prompt ( ** prompt_kwargs ) } ' )
409+
409410
410411 step_count += 1
411412
@@ -480,7 +481,8 @@ async def impl_astream(
480481 if not isinstance (function_result , FunctionOutput ):
481482 raise ValueError (f"Result must be wrapped in FunctionOutput, got { type (function_result )} " )
482483
483- function_output = function_result .output
484+ function_output = function_result .output
485+ # TODO: function needs a stream_events
484486 real_function_output = None
485487
486488 if inspect .iscoroutine (function_output ):
@@ -493,6 +495,9 @@ async def impl_astream(
493495 self ._event_queue .put_nowait (item )
494496 function_results .append (item )
495497 real_function_output = function_results [- 1 ]
498+ else :
499+ real_function_output = function_output
500+ self ._event_queue .put_nowait (function_output )
496501 # function_results = []
497502 # async for item in function_output:
498503 # function_results.append(item)
0 commit comments