Hey,
I’m trying to make a loop of implement -> test -> implement -> test
conditional tasks in my coding crew:
@task
def implement_support_files(self) -> Task:
return Task(
config=self.tasks_config['implement_support_files'],
context=[self.analyze_requirements(), self.design_project_structure(), self.implement_crew_logic()],
tools=[file_write_tool, code_interpreter_tool]
)
@task
def review_implementation(self) -> Task:
return Task(
config=self.tasks_config['review_implementation'],
context=[self.implement_crew_logic(), self.implement_support_files()],
tools=[file_read_tool, docsSearchTool, self.directorySearchTool],
callback=self.implement_review_changes
)
@task
def implement_review_changes(self) -> Task:
return Task(
config=self.tasks_config['implement_review_changes'],
context=[self.review_implementation()],
tools=[file_write_tool, code_interpreter_tool],
callback=self._track_review_iteration
)
def _track_review_iteration(self, output):
self.review_iteration = getattr(self, 'review_iteration', 0) + 1
if self.review_iteration < 2 and 'ISSUES FOUND:' in output.raw:
return self.review_implementation()
return output
is there a way to run Task
in callback
function?
If not - what the best way to do so? What i want is that one agent review the other’s agent task result a few times.