adding support for step_callback

This commit is contained in:
João Moura
2024-02-08 23:56:13 -08:00
parent 326ad08ba2
commit 596e243374
3 changed files with 527 additions and 3 deletions

View File

@@ -68,7 +68,10 @@ class CrewAgentExecutor(AgentExecutor):
return self._return(
next_step_output, intermediate_steps, run_manager=run_manager
)
self.step_callback(next_step_output)
if self.step_callback:
self.step_callback(next_step_output)
intermediate_steps.extend(next_step_output)
if len(next_step_output) == 1:
next_step_action = next_step_output[0]