File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
agentops/instrumentation/ag2 Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 55than individual message exchanges.
66"""
77
8- from agentops .instrumentation .ag2 .instrumentor import AG2Instrumentor
9- from agentops .instrumentation .ag2 .version import LIBRARY_NAME , LIBRARY_VERSION
8+ from agentops .logging import logger
9+
10+
11+ def get_version () -> str :
12+ """Get the version of the AG2 package, or 'unknown' if not found"""
13+ try :
14+ from importlib .metadata import version
15+
16+ return version ("ag2" )
17+ except ImportError :
18+ logger .debug ("Could not find AG2 version" )
19+ return "unknown"
20+
21+
22+ LIBRARY_NAME = "ag2"
23+ LIBRARY_VERSION : str = get_version ()
24+
25+ # Import after defining constants to avoid circular imports
26+ from agentops .instrumentation .ag2 .instrumentor import AG2Instrumentor # noqa: E402
1027
1128__all__ = ["AG2Instrumentor" , "LIBRARY_NAME" , "LIBRARY_VERSION" ]
Original file line number Diff line number Diff line change 1313from wrapt import wrap_function_wrapper
1414
1515from agentops .logging import logger
16- from agentops .instrumentation .ag2 . version import LIBRARY_NAME , LIBRARY_VERSION
16+ from agentops .instrumentation .ag2 import LIBRARY_NAME , LIBRARY_VERSION
1717from agentops .semconv import Meters
1818from agentops .semconv .message import MessageAttributes
1919from agentops .semconv .span_attributes import SpanAttributes
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments