mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-01 15:22:37 +00:00
Enhance event handling for Crew, Task, and Event classes
- Add crew name to failed event types (CrewKickoffFailedEvent, CrewTrainFailedEvent, CrewTestFailedEvent) - Update Task events to remove redundant task and context attributes - Refactor EventListener to use Logger for consistent event logging - Add new event types for Crew train and test events - Improve event bus event tracking in test cases
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
|
||||
from crewai.utilities.events.crew_events import CrewEvent
|
||||
|
||||
@@ -6,16 +6,15 @@ from crewai.utilities.events.crew_events import CrewEvent
|
||||
class TaskStartedEvent(CrewEvent):
|
||||
"""Event emitted when a task starts"""
|
||||
|
||||
task: Any
|
||||
type: str = "task_started"
|
||||
|
||||
context: Optional[str]
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
|
||||
|
||||
|
||||
class TaskCompletedEvent(CrewEvent):
|
||||
"""Event emitted when a task completes"""
|
||||
|
||||
task: Any
|
||||
output: Any
|
||||
type: str = "task_completed"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user