added docs and tests

This commit is contained in:
Lorenze Jay
2024-07-16 16:04:41 -07:00
parent bc7f601f84
commit ef928ee3cb
6 changed files with 111 additions and 3 deletions

View File

@@ -660,7 +660,7 @@ class Crew(BaseModel):
previous_output
):
self._logger.log(
"info",
"debug",
f"Skipping conditional task: {task.description}",
color="yellow",
)
@@ -670,6 +670,7 @@ class Crew(BaseModel):
agent=task.agent.role if task.agent else "",
output_format=OutputFormat.RAW,
)
if not was_replayed:
self._store_execution_log(
task,

View File

@@ -18,11 +18,10 @@ class ConditionalTask(Task):
def __init__(
self,
*args,
condition: Callable[[Any], bool],
**kwargs,
):
super().__init__(*args, **kwargs)
super().__init__(**kwargs)
self.condition = condition
def should_execute(self, context: TaskOutput) -> bool: