Skip to content

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

improve error message when agentops is already inited (#330)

Shawn Qiu49a748b8b0f2
diff --git a/agentops/__init__.py b/agentops/__init__.py
index 24fd1cc3..fc00e71a 100755
--- a/agentops/__init__.py
+++ b/agentops/__init__.py
@@ -65,7 +65,9 @@ def init(
check_agentops_update()
if Client().is_initialized:
- return logger.warning("AgentOps has already been initialized")
+ return logger.warning(
+ "AgentOps has already been initialized. If you are trying to start a session, call agentops.start_session() instead."
+ )
if tags is not None:
logger.warning("The 'tags' parameter is deprecated. Use 'default_tags' instead")