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

tag fix

Braelyn Boynton35daf2b350be
diff --git a/agentops/client.py b/agentops/client.py
index d4ed81d6..839b439c 100644
--- a/agentops/client.py
+++ b/agentops/client.py
@@ -275,9 +275,7 @@ class Client:
if self._session is not None:
return print("Session already started. End this session before starting a new one.")
- self._session = Session(str(uuid4()), tags)
- if self._tags:
- self.set_tags(self._tags)
+ self._session = Session(str(uuid4()), tags or self._tags)
self._worker = Worker(self.config)
self._worker.start_session(self._session)
@@ -296,11 +294,13 @@ class Client:
end_state_reason (str, optional): The reason for ending the session.
video (str, optional): The video screen recording of the session
"""
+ if self._session is None:
+ return print("Session has already been ended.")
if not self._session.has_ended:
self._session.video = video
self._session.end_session(end_state, rating, end_state_reason)
self._worker.end_session(self._session)
- self._session = None
+ # self._session = None
else:
logging.info("Warning: The session has already been ended.")