Remove telemetry and tracing dependencies from Task and Flow classes

- Remove telemetry-related imports and private attributes from Task class
- Remove `_telemetry` attribute from Flow class
- Update event handling to emit events without direct telemetry tracking
- Simplify task and flow execution by removing explicit telemetry spans
- Move telemetry-related event handling to EventListener
This commit is contained in:
Lorenze Jay
2025-02-13 17:54:45 -08:00
parent 00a98cd5c9
commit 184d08e6e7
9 changed files with 1036 additions and 87 deletions

View File

@@ -1,5 +1,4 @@
from typing import Any, Optional
from crewai.utilities.events.crew_events import CrewEvent
@@ -8,7 +7,6 @@ class TaskStartedEvent(CrewEvent):
type: str = "task_started"
context: Optional[str]
model_config = {"arbitrary_types_allowed": True}
@@ -18,12 +16,11 @@ class TaskCompletedEvent(CrewEvent):
output: Any
type: str = "task_completed"
model_config = {"arbitrary_types_allowed": True}
class TaskFailedEvent(CrewEvent):
"""Event emitted when a task fails"""
task: Any
error: str
type: str = "task_failed"