Skip to content

Commit a369761

Browse files
committed
cleanup
1 parent efacc7c commit a369761

6 files changed

Lines changed: 165 additions & 318 deletions

File tree

agentops/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
track_agent,
66
track_tool,
77
end_all_sessions,
8-
Session,
8+
Session as LegacySession,
99
ToolEvent,
1010
ErrorEvent,
1111
ActionEvent,
@@ -104,7 +104,7 @@ def init(
104104
)
105105

106106

107-
def configure(**kwargs):
107+
def configure(**kwargs: Any) -> None:
108108
"""Update client configuration
109109
110110
Args:
@@ -219,7 +219,7 @@ def end_trace(trace_context: TraceContext, end_state: str = "Success") -> None:
219219
"track_agent",
220220
"track_tool",
221221
"end_all_sessions",
222-
"Session",
222+
"LegacySession",
223223
"ToolEvent",
224224
"ErrorEvent",
225225
"ActionEvent",

agentops/client/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import atexit
2-
from typing import Optional
2+
from typing import Optional, Any
33

44
from agentops.client.api import ApiClient
55
from agentops.config import Config
@@ -49,7 +49,7 @@ class Client:
4949

5050
api: ApiClient
5151

52-
def __new__(cls, *args, **kwargs):
52+
def __new__(cls, *args: Any, **kwargs: Any) -> "Client":
5353
if cls.__instance is None:
5454
cls.__instance = super(Client, cls).__new__(cls)
5555
# Initialize instance variables that should only be set once per instance
@@ -69,7 +69,7 @@ def __init__(self):
6969
# self._init_trace_context = None # Already done in __new__
7070
# self._legacy_session_for_init_trace = None # Already done in __new__
7171

72-
def init(self, **kwargs) -> None: # Return type updated to None
72+
def init(self, **kwargs: Any) -> None: # Return type updated to None
7373
# Recreate the Config object to parse environment variables at the time of initialization
7474
# This allows re-init with new env vars if needed, though true singletons usually init once.
7575
self.config = Config()
@@ -168,7 +168,7 @@ def init(self, **kwargs) -> None: # Return type updated to None
168168
self._initialized = True # Successfully initialized, just no auto-trace
169169
return None # No auto-session, so return None
170170

171-
def configure(self, **kwargs):
171+
def configure(self, **kwargs: Any) -> None:
172172
"""Update client configuration"""
173173
self.config.configure(**kwargs)
174174

@@ -177,7 +177,7 @@ def initialized(self) -> bool:
177177
return self._initialized
178178

179179
@initialized.setter
180-
def initialized(self, value: bool):
180+
def initialized(self, value: bool) -> None:
181181
if self._initialized and self._initialized != value:
182182
# Allow re-setting to False if we are intentionally re-initializing
183183
# This logic is now partly in init() to handle re-init cases

0 commit comments

Comments
 (0)