mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 16:22:49 +00:00
Improve AgentOps listener type hints and formatting
- Add string type hints for AgentOps classes to resolve potential import issues - Clean up unnecessary whitespace and improve code indentation - Simplify initialization and event handling logic
This commit is contained in:
@@ -18,8 +18,8 @@ except ImportError:
|
||||
|
||||
|
||||
class AgentOpsListener(BaseEventListener):
|
||||
tool_event: Optional[agentops.ToolEvent] = None
|
||||
session: Optional[agentops.Session] = None
|
||||
tool_event: Optional["agentops.ToolEvent"] = None
|
||||
session: Optional["agentops.Session"] = None
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
@@ -28,8 +28,6 @@ class AgentOpsListener(BaseEventListener):
|
||||
if not AGENTOPS_INSTALLED:
|
||||
return
|
||||
|
||||
|
||||
|
||||
@event_bus.on(CrewKickoffStartedEvent)
|
||||
def on_crew_kickoff_started(source, event: CrewKickoffStartedEvent):
|
||||
self.session = agentops.init()
|
||||
|
||||
Reference in New Issue
Block a user