Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI
Python agentagentopsagents-sdkaianthropicautogencost-estimationcrewaievalsevaluation-metricsgroqlangchainllmmistralollamaopenaiopenai-agents
Removing dateutil from previous commit (#404)
Howard Gil6c9f892ea9c9
diff --git a/agentops/session.py b/agentops/session.pyindex a82eeb35..f5722af4 100644--- a/agentops/session.py+++ b/agentops/session.py@@ -7,7 +7,7 @@ from decimal import ROUND_HALF_UP, Decimalfrom termcolor import coloredfrom typing import Optional, List, Unionfrom uuid import UUID, uuid4-from dateutil import parser+from datetime import datetimefrom .exceptions import ApiServerExceptionfrom .enums import EndState@@ -106,7 +106,10 @@ class Session:self._flush_queue()def format_duration(start_time, end_time):- duration = parser.parse(end_time) - parser.parse(start_time)+ start = datetime.fromisoformat(start_time.replace("Z", "+00:00"))+ end = datetime.fromisoformat(end_time.replace("Z", "+00:00"))+ duration = end - start+hours, remainder = divmod(duration.total_seconds(), 3600)minutes, seconds = divmod(remainder, 60)