mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Add default model for CrewEvaluator and fix event import order
- Set default model to "gpt-4o-mini" in CrewEvaluator when no model is specified - Reorder event-related imports in task.py to follow standard import conventions - Update event bus initialization method return type hint - Export event_bus in events/__init__.py
This commit is contained in:
@@ -1209,7 +1209,7 @@ class Crew(BaseModel):
|
||||
),
|
||||
)
|
||||
test_crew = self.copy()
|
||||
evaluator = CrewEvaluator(test_crew, openai_model_name)
|
||||
evaluator = CrewEvaluator(test_crew, openai_model_name or "gpt-4o-mini")
|
||||
|
||||
for i in range(1, n_iterations + 1):
|
||||
evaluator.set_iteration(i)
|
||||
|
||||
@@ -40,12 +40,12 @@ from crewai.telemetry.telemetry import Telemetry
|
||||
from crewai.tools.base_tool import BaseTool
|
||||
from crewai.utilities.config import process_config
|
||||
from crewai.utilities.converter import Converter, convert_to_model
|
||||
from crewai.utilities.events.event_bus import event_bus
|
||||
from crewai.utilities.events import (
|
||||
TaskCompletedEvent,
|
||||
TaskFailedEvent,
|
||||
TaskStartedEvent,
|
||||
)
|
||||
from crewai.utilities.events.event_bus import event_bus
|
||||
from crewai.utilities.i18n import I18N
|
||||
from crewai.utilities.printer import Printer
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from .flow_events import (
|
||||
MethodExecutionStartedEvent,
|
||||
MethodExecutionFinishedEvent,
|
||||
)
|
||||
from .event_bus import EventTypes, EventBus
|
||||
from .event_bus import EventTypes, EventBus, event_bus
|
||||
from .tool_usage_events import ToolUsageFinishedEvent, ToolUsageErrorEvent
|
||||
|
||||
# events
|
||||
|
||||
@@ -28,7 +28,7 @@ class EventBus:
|
||||
cls._instance._initialize()
|
||||
return cls._instance
|
||||
|
||||
def _initialize(self):
|
||||
def _initialize(self) -> None:
|
||||
"""Initialize the event bus internal state"""
|
||||
self._signal = Signal("event_bus")
|
||||
self._handlers: Dict[
|
||||
|
||||
Reference in New Issue
Block a user