Refactor AgentOps event listener for crew-level tracking

- Modify AgentOpsListener to handle crew-level events
- Initialize and end AgentOps session at crew kickoff and completion
- Create agents for each crew member during session initialization
- Improve session management and event recording
- Clean up and simplify event handling logic
This commit is contained in:
Lorenze Jay
2025-02-14 15:49:42 -08:00
parent 18791eadd3
commit ec048cf6fe
6 changed files with 43 additions and 27 deletions

View File

@@ -3,10 +3,10 @@ from typing import List
from pydantic import BaseModel, Field
from crewai.utilities import Converter
from crewai.utilities.events import event_bus
from crewai.utilities.events import TaskEvaluationEvent
from crewai.utilities.events import TaskEvaluationEvent, event_bus
from crewai.utilities.pydantic_schema_parser import PydanticSchemaParser
class Entity(BaseModel):
name: str = Field(description="The name of the entity.")
type: str = Field(description="The type of the entity.")