Refactor event handling and introduce new event types

- Migrate from global `emit` function to `event_bus.emit`
- Add new event types for task failures, tool usage, and agent execution
- Update event listeners and event bus to support more granular event tracking
- Remove deprecated event emission methods
- Improve event type consistency and add more detailed event information
This commit is contained in:
Lorenze Jay
2025-02-11 14:31:50 -08:00
parent 95bae8bba3
commit 676cabfdd6
19 changed files with 7369 additions and 441 deletions

View File

@@ -20,3 +20,11 @@ class TaskCompleted(CrewEvent):
type: str = "task_completed"
model_config = {"arbitrary_types_allowed": True}
class TaskFailed(CrewEvent):
"""Event emitted when a task fails"""
task: Any
error: str
type: str = "task_failed"