Revert "true dependency"

This reverts commit e52e8e9568.
This commit is contained in:
Braelyn Boynton
2024-04-19 19:01:52 -07:00
parent 216cc832dc
commit 4d1b460b80
3 changed files with 13 additions and 6 deletions

View File

@@ -26,7 +26,10 @@ from crewai.task import Task
from crewai.telemetry import Telemetry
from crewai.tools.agent_tools import AgentTools
from crewai.utilities import I18N, FileHandler, Logger, RPMController
import agentops
try:
import agentops
except ImportError:
agentops = None
class Crew(BaseModel):
@@ -376,7 +379,8 @@ class Crew(BaseModel):
def _finish_execution(self, output) -> None:
if self.max_rpm:
self._rpm_controller.stop_rpm_counter()
agentops.end_session(end_state="Success", end_state_reason="Finished Execution")
if agentops:
agentops.end_session(end_state="Success", end_state_reason="Finished Execution")
self._telemetry.end_crew(self, output)
def __repr__(self):