mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
* Support wildcard handling in `emit()` Change `emit()` to call handlers registered for parent classes using `isinstance()`. Ensures that base event handlers receive derived events. * Fix failing test * Remove unused variable * update interpolation to work with example response types in yaml docs * make tests * fix circular deps * Fixing interpolation imports * Improve test --------- Co-authored-by: Vinicius Brasil <vini@hey.com> Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
23 lines
721 B
Python
23 lines
721 B
Python
import re
|
|
from typing import TYPE_CHECKING, List
|
|
|
|
if TYPE_CHECKING:
|
|
from crewai.task import Task
|
|
from crewai.tasks.task_output import TaskOutput
|
|
|
|
|
|
def aggregate_raw_outputs_from_task_outputs(task_outputs: List["TaskOutput"]) -> str:
|
|
"""Generate string context from the task outputs."""
|
|
dividers = "\n\n----------\n\n"
|
|
|
|
# Join task outputs with dividers
|
|
context = dividers.join(output.raw for output in task_outputs)
|
|
return context
|
|
|
|
|
|
def aggregate_raw_outputs_from_tasks(tasks: List["Task"]) -> str:
|
|
"""Generate string context from the tasks."""
|
|
task_outputs = [task.output for task in tasks if task.output is not None]
|
|
|
|
return aggregate_raw_outputs_from_task_outputs(task_outputs)
|