mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
AgentOps Implementation (#411)
* implements agentops with a langchain handler, agent tracking and tool call recording * track tool usage * end session after completion * track tool usage time * better tool and llm tracking * code cleanup * make agentops optional * optional dependency usage * remove telemetry code * optional agentops * agentops version bump * remove org key * true dependency * add crew org key to agentops * cleanup * Update pyproject.toml * Revert "true dependency" This reverts commite52e8e9568. * Revert "cleanup" This reverts commit7f5635fb9e. * optional parent key * agentops 0.1.5 * Revert "Revert "cleanup"" This reverts commitcea33d9a5d. * Revert "Revert "true dependency"" This reverts commit4d1b460b* cleanup * Forcing version 0.1.5 * Update pyproject.toml --------- Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ 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
|
||||
|
||||
|
||||
class Crew(BaseModel):
|
||||
@@ -239,6 +240,7 @@ class Crew(BaseModel):
|
||||
self._set_tasks_callbacks()
|
||||
|
||||
i18n = I18N(language=self.language, language_file=self.language_file)
|
||||
agentops.set_parent_key("daebe730-f54d-4af5-98df-e6946fb76d13")
|
||||
|
||||
for agent in self.agents:
|
||||
agent.i18n = i18n
|
||||
@@ -374,6 +376,7 @@ 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")
|
||||
self._telemetry.end_crew(self, output)
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user