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

optionally bypass create new session on client init

Braelyn Boyntond05821794b5c
diff --git a/agentops/client.py b/agentops/client.py
index 4e982f93..455ffdb4 100644
--- a/agentops/client.py
+++ b/agentops/client.py
@@ -45,7 +45,9 @@ class Client:
endpoint: Optional[str] = 'https://agentops-server-v2.fly.dev',
max_wait_time: Optional[int] = 1000,
max_queue_size: Optional[int] = 100,
- override=True):
+ override=True,
+ bypass_new_session=False
+ ):
# Get API key from env
if api_key is None:
@@ -69,7 +71,8 @@ class Client:
# Override sys.excepthook
sys.excepthook = self.handle_exception
- self._start_session(tags)
+ if not bypass_new_session:
+ self._start_session(tags)
if override:
if 'openai' in sys.modules: