Skip to content

Commit 578fe3a

Browse files
committed
fixes
1 parent 4534981 commit 578fe3a

101 files changed

Lines changed: 176 additions & 368 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agentops/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# For backwards compatibility
2+
from agentops.legacy import (
3+
start_session,
4+
end_session,
5+
track_agent,
6+
track_tool,
7+
end_all_sessions,
8+
) # type: ignore
9+
110
from typing import List, Optional, Union
211
from agentops.client import Client
312

@@ -158,10 +167,6 @@ def configure(**kwargs):
158167
_client.configure(**kwargs)
159168

160169

161-
# For backwards compatibility
162-
163-
from agentops.legacy import * # type: ignore
164-
165170
__all__ = [
166171
"init",
167172
"configure",
@@ -171,4 +176,5 @@ def configure(**kwargs):
171176
"end_session",
172177
"track_agent",
173178
"track_tool",
179+
"end_all_sessions",
174180
]

agentops/client/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This module provides the client for the AgentOps API.
55
"""
66

7-
from typing import Dict, Optional, Type, TypeVar, cast
7+
from typing import Dict, Type, TypeVar, cast
88

99
from agentops.client.api.base import BaseApiClient
1010
from agentops.client.api.types import AuthTokenResponse

agentops/client/api/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
import requests
1010

11-
from agentops.client.api.types import AuthTokenResponse
1211
from agentops.client.http.http_client import HttpClient
1312

1413

1514
class TokenFetcher(Protocol):
1615
"""Protocol for token fetching functions"""
1716

18-
def __call__(self, api_key: str) -> str: ...
17+
def __call__(self, api_key: str) -> str:
18+
...
1919

2020

2121
class BaseApiClient:

agentops/client/api/versions/v3.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
This module provides the client for the V3 version of the AgentOps API.
55
"""
66

7-
from typing import Any, Dict, List, Optional
8-
9-
import requests
10-
117
from agentops.client.api.base import BaseApiClient
128
from agentops.client.api.types import AuthTokenResponse
139
from agentops.exceptions import ApiServerException

agentops/client/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from typing import List, Optional, Union
21
import atexit
32

43
from agentops.client.api import ApiClient
54
from agentops.config import Config
6-
from agentops.exceptions import AgentOpsClientNotInitializedException, NoApiKeyException, NoSessionException
5+
from agentops.exceptions import NoApiKeyException
76
from agentops.instrumentation import instrument_all
87
from agentops.logging import logger
98
from agentops.logging.config import configure_logging, intercept_opentelemetry_logging

agentops/client/http/http_adapter.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
from typing import Callable, Dict, Optional, Union
1+
from typing import Optional
22

33
from requests.adapters import HTTPAdapter
44
from urllib3.util import Retry
55

66
# from agentops.client.auth_manager import AuthManager
7-
from agentops.exceptions import AgentOpsApiJwtExpiredException, ApiServerException
8-
from agentops.logging import logger
9-
from agentops.client.api.types import AuthTokenResponse
107

118

129
class BaseHTTPAdapter(HTTPAdapter):

agentops/client/http/http_client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
from typing import Callable, Dict, Optional
1+
from typing import Dict, Optional
22

33
import requests
44

55
from agentops.client.http.http_adapter import BaseHTTPAdapter
6-
from agentops.exceptions import AgentOpsApiJwtExpiredException, ApiServerException
76
from agentops.logging import logger
8-
from agentops.semconv import ResourceAttributes
97

108

119
class HttpClient:

agentops/config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import logging
33
import os
44
import sys
5-
from dataclasses import asdict, dataclass, field
6-
from typing import Any, List, Optional, Set, TypedDict, Union
5+
from dataclasses import dataclass, field
6+
from typing import List, Optional, Set, TypedDict, Union
77
from uuid import UUID
88

99
from opentelemetry.sdk.trace import SpanProcessor
@@ -13,8 +13,6 @@
1313
from agentops.helpers.env import get_env_bool, get_env_int, get_env_list
1414
from agentops.helpers.serialization import AgentOpsJSONEncoder
1515

16-
from .logging.config import logger
17-
1816

1917
class ConfigDict(TypedDict):
2018
api_key: Optional[str]

agentops/exceptions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from agentops.logging import logger
2-
3-
41
class MultiSessionException(Exception):
52
def __init__(self, message):
63
super().__init__(message)

agentops/instrumentation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional
1+
from typing import Optional
22
from types import ModuleType
33
from dataclasses import dataclass
44
import importlib

0 commit comments

Comments
 (0)