Rename event_bus to crewai_event_bus for improved clarity and specificity

- Replace all references to `event_bus` with `crewai_event_bus`
- Update import statements across multiple files
- Remove the old `event_bus.py` file
- Maintain existing event handling functionality
This commit is contained in:
Lorenze Jay
2025-02-18 08:36:21 -08:00
parent 1603a1d9ac
commit 64569ce130
17 changed files with 182 additions and 296 deletions

View File

@@ -3,7 +3,7 @@ from typing import List
from pydantic import BaseModel, Field
from crewai.utilities import Converter
from crewai.utilities.events import TaskEvaluationEvent, event_bus
from crewai.utilities.events import TaskEvaluationEvent, crewai_event_bus
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
@@ -44,7 +44,9 @@ class TaskEvaluator:
self.original_agent = original_agent
def evaluate(self, task, output) -> TaskEvaluation:
event_bus.emit(self, TaskEvaluationEvent(evaluation_type="task_evaluation"))
crewai_event_bus.emit(
self, TaskEvaluationEvent(evaluation_type="task_evaluation")
)
evaluation_query = (
f"Assess the quality of the task completed based on the description, expected output, and actual results.\n\n"
f"Task Description:\n{task.description}\n\n"
@@ -81,7 +83,9 @@ class TaskEvaluator:
- training_data (dict): The training data to be evaluated.
- agent_id (str): The ID of the agent.
"""
event_bus.emit(self, TaskEvaluationEvent(evaluation_type="training_data_evaluation"))
crewai_event_bus.emit(
self, TaskEvaluationEvent(evaluation_type="training_data_evaluation")
)
output_training_data = training_data[agent_id]
final_aggregated_data = ""