From 706ff0c013f2fa3cafab71460405b11ff12d25f9 Mon Sep 17 00:00:00 2001 From: fenilfaldu Date: Mon, 7 Apr 2025 02:39:32 +0530 Subject: [PATCH] refactored client initialization --- agentops/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agentops/__init__.py b/agentops/__init__.py index eefe0f2f2..16e3a7276 100755 --- a/agentops/__init__.py +++ b/agentops/__init__.py @@ -78,6 +78,12 @@ def init( """ global _client + if _client.initialized: + from .logging.config import logger + + return logger.warning( + "AgentOps has already been initialized. If you are trying to start a session, call agentops.start_session() instead." + ) # Merge tags and default_tags if both are provided merged_tags = None if tags and default_tags: