aixtools 0.2.14__py3-none-any.whl → 0.2.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aixtools might be problematic. Click here for more details.
- aixtools/_version.py +2 -2
- aixtools/logging/log_objects.py +6 -5
- aixtools/logging/model_patch_logging.py +6 -6
- aixtools/mcp/client.py +2 -2
- {aixtools-0.2.14.dist-info → aixtools-0.2.15.dist-info}/METADATA +1 -1
- {aixtools-0.2.14.dist-info → aixtools-0.2.15.dist-info}/RECORD +9 -9
- {aixtools-0.2.14.dist-info → aixtools-0.2.15.dist-info}/WHEEL +0 -0
- {aixtools-0.2.14.dist-info → aixtools-0.2.15.dist-info}/entry_points.txt +0 -0
- {aixtools-0.2.14.dist-info → aixtools-0.2.15.dist-info}/top_level.txt +0 -0
aixtools/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.2.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 2,
|
|
31
|
+
__version__ = version = '0.2.15'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 2, 15)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
aixtools/logging/log_objects.py
CHANGED
|
@@ -107,11 +107,11 @@ def safe_deepcopy(obj):
|
|
|
107
107
|
return None # fallback for non-serializable, non-introspectable objects
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
def save_objects_to_logfile(objects: list, log_dir=LOGS_DIR):
|
|
110
|
+
async def save_objects_to_logfile(objects: list, log_dir=LOGS_DIR):
|
|
111
111
|
"""Save the objects to a (pickle) log file"""
|
|
112
112
|
with ObjectLogger(log_dir=log_dir) as object_logger:
|
|
113
113
|
for obj in objects:
|
|
114
|
-
object_logger.log(obj)
|
|
114
|
+
await object_logger.log(obj)
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
class BaseLogger:
|
|
@@ -144,7 +144,7 @@ class ObjectLogger(BaseLogger):
|
|
|
144
144
|
log_dir=LOGS_DIR,
|
|
145
145
|
verbose: bool = True,
|
|
146
146
|
debug: bool | None = None,
|
|
147
|
-
parent_logger: Union["
|
|
147
|
+
parent_logger: Union["BaseLogger", NoneType] = None,
|
|
148
148
|
):
|
|
149
149
|
self.verbose = verbose
|
|
150
150
|
self.debug = (
|
|
@@ -195,8 +195,9 @@ class ObjectLogger(BaseLogger):
|
|
|
195
195
|
elif self.verbose:
|
|
196
196
|
print(obj, flush=True)
|
|
197
197
|
obj_to_save = safe_deepcopy(obj)
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
if self.file is not None:
|
|
199
|
+
pickle.dump(obj_to_save, self.file)
|
|
200
|
+
self.file.flush() # ensure it's written immediately
|
|
200
201
|
except Exception as e: # pylint: disable=broad-exception-caught
|
|
201
202
|
logger.error("Failed to log object: %s", e)
|
|
202
203
|
logger.error(traceback.format_exc())
|
|
@@ -27,16 +27,16 @@ def log_async_method(fn, agent_logger):
|
|
|
27
27
|
# Log request
|
|
28
28
|
uuid = str(uuid4()) # Create a unique ID for this request
|
|
29
29
|
log_object = ModelRawRequest(method_name=fn.__name__, request_id=uuid, args=args, kwargs=kwargs)
|
|
30
|
-
agent_logger.log(log_object)
|
|
30
|
+
await agent_logger.log(log_object)
|
|
31
31
|
# Invoke the original method
|
|
32
32
|
try:
|
|
33
33
|
result = await fn(*args, **kwargs)
|
|
34
34
|
# Log results
|
|
35
35
|
log_object = ModelRawRequestResult(method_name=fn.__name__, request_id=uuid, result=result)
|
|
36
|
-
agent_logger.log(log_object)
|
|
36
|
+
await agent_logger.log(log_object)
|
|
37
37
|
except Exception as e:
|
|
38
38
|
# Log exception
|
|
39
|
-
agent_logger.log(e)
|
|
39
|
+
await agent_logger.log(e)
|
|
40
40
|
raise e
|
|
41
41
|
return result
|
|
42
42
|
|
|
@@ -52,7 +52,7 @@ def log_async_stream(fn, agent_logger):
|
|
|
52
52
|
# Log request
|
|
53
53
|
uuid = str(uuid4()) # Create a unique ID for this request
|
|
54
54
|
log_object = ModelRawRequest(method_name=fn.__name__, request_id=uuid, args=args, kwargs=kwargs)
|
|
55
|
-
agent_logger.log(log_object)
|
|
55
|
+
await agent_logger.log(log_object)
|
|
56
56
|
# Invoke the original method
|
|
57
57
|
async with fn(*args, **kwargs) as stream:
|
|
58
58
|
|
|
@@ -64,12 +64,12 @@ def log_async_stream(fn, agent_logger):
|
|
|
64
64
|
log_object = ModelRawRequestYieldItem(
|
|
65
65
|
method_name=fn.__name__, request_id=uuid, item=item, item_num=item_num
|
|
66
66
|
)
|
|
67
|
-
agent_logger.log(log_object)
|
|
67
|
+
await agent_logger.log(log_object)
|
|
68
68
|
item_num += 1
|
|
69
69
|
yield item
|
|
70
70
|
except Exception as e:
|
|
71
71
|
# Log exception
|
|
72
|
-
agent_logger.log(e)
|
|
72
|
+
await agent_logger.log(e)
|
|
73
73
|
raise e
|
|
74
74
|
|
|
75
75
|
yield gen()
|
aixtools/mcp/client.py
CHANGED
|
@@ -52,7 +52,7 @@ async def default_mcp_log_handler(message: LogMessage):
|
|
|
52
52
|
def get_mcp_client(
|
|
53
53
|
url: str | None = None,
|
|
54
54
|
command: str | None = None,
|
|
55
|
-
args: list[str] = None,
|
|
55
|
+
args: list[str] | None = None,
|
|
56
56
|
log_handler: callable = default_mcp_log_handler, # type: ignore
|
|
57
57
|
) -> MCPServerStreamableHTTP | MCPServerStdio:
|
|
58
58
|
"""
|
|
@@ -67,7 +67,7 @@ def get_mcp_client(
|
|
|
67
67
|
if args is None:
|
|
68
68
|
args = []
|
|
69
69
|
if url:
|
|
70
|
-
return MCPServerStreamableHTTP(url=
|
|
70
|
+
return MCPServerStreamableHTTP(url=url, log_handler=log_handler)
|
|
71
71
|
if command:
|
|
72
72
|
return MCPServerStdio(command=command, args=args, log_handler=log_handler)
|
|
73
73
|
raise ValueError("Either url or command must be provided to create MCP client.")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
aixtools/__init__.py,sha256=9NGHm7LjsQmsvjTZvw6QFJexSvAU4bCoN_KBk9SCa00,260
|
|
2
|
-
aixtools/_version.py,sha256=
|
|
2
|
+
aixtools/_version.py,sha256=fu32ckCvDvmdBESK9QY8685INg5f0hTCLuUhaNOVaJQ,706
|
|
3
3
|
aixtools/app.py,sha256=JzQ0nrv_bjDQokllIlGHOV0HEb-V8N6k_nGQH-TEsVU,5227
|
|
4
4
|
aixtools/chainlit.md,sha256=yC37Ly57vjKyiIvK4oUvf4DYxZCwH7iocTlx7bLeGLU,761
|
|
5
5
|
aixtools/context.py,sha256=I_MD40ZnvRm5WPKAKqBUAdXIf8YaurkYUUHSVVy-QvU,598
|
|
@@ -52,14 +52,14 @@ aixtools/log_view/node_summary.py,sha256=EJjnBqdBWI-_bI-4nfTxwaost3mtiufb5cK7T54
|
|
|
52
52
|
aixtools/logfilters/__init__.py,sha256=pTD8ujCqjPWBCeB7yv7lmCtnA2KXOnkIv0HExDagkXs,129
|
|
53
53
|
aixtools/logfilters/context_filter.py,sha256=zR3Bnv3fCqXLeb7bCFTmlnWhC6dFIvUb-u712tOnUPk,2259
|
|
54
54
|
aixtools/logging/__init__.py,sha256=b5oYyGQDUHHxhRtzqKUaQPv8hQeWw54rzDXSV8lDY1w,613
|
|
55
|
-
aixtools/logging/log_objects.py,sha256=
|
|
55
|
+
aixtools/logging/log_objects.py,sha256=K8p2kHTqr9nntHQ0-jyNrDBoBiqH14gFnD7atAiN_do,6964
|
|
56
56
|
aixtools/logging/logging_config.py,sha256=LvxV3C75-I0096PpcCIbgM-Cp998LzWXeMM14HYbU20,4985
|
|
57
57
|
aixtools/logging/mcp_log_models.py,sha256=7-H2GJXiiyLhpImuyLLftAGG4skxJal8Swax0ob04MY,3463
|
|
58
58
|
aixtools/logging/mcp_logger.py,sha256=d2I5l4t0d6rQH17w23FpE1IUD8Ax-mSaKfByCH86q4I,6257
|
|
59
|
-
aixtools/logging/model_patch_logging.py,sha256=
|
|
59
|
+
aixtools/logging/model_patch_logging.py,sha256=CW5-kKI-zNEgZhNV4vx3EQu6fbrEtX7VjA6fE5loRLQ,2916
|
|
60
60
|
aixtools/logging/open_telemetry.py,sha256=fJjF1ou_8GyfNfbyWDQPGK6JAUrUaPwURYPHhXEtDBE,1121
|
|
61
61
|
aixtools/mcp/__init__.py,sha256=Qp4uD1RtypCYgzWrt_ThBVxa5-CFBgcwMWkHbHFUQ54,232
|
|
62
|
-
aixtools/mcp/client.py,sha256=
|
|
62
|
+
aixtools/mcp/client.py,sha256=0UR3KiPCg7WAEf8u4-ewp3H_hiaMwD9KKmx2XRzdA_8,18271
|
|
63
63
|
aixtools/mcp/example_client.py,sha256=QCFGP3NCNJMOKWjUOnFwjnbJhUSb879IA1ZYmwjRnmc,889
|
|
64
64
|
aixtools/mcp/example_server.py,sha256=1SWCyrLWsAnOa81HC4QbPJo_lBVu0b3SZBWI-qDh1vQ,458
|
|
65
65
|
aixtools/mcp/exceptions.py,sha256=9m3hy9fRINbXTSgkE71XW_luklgH6xBRp7VnSRfpyzQ,173
|
|
@@ -89,8 +89,8 @@ aixtools/utils/chainlit/cl_agent_show.py,sha256=vaRuowp4BRvhxEr5hw0zHEJ7iaSF_5bo
|
|
|
89
89
|
aixtools/utils/chainlit/cl_utils.py,sha256=fxaxdkcZg6uHdM8uztxdPowg3a2f7VR7B26VPY4t-3c,5738
|
|
90
90
|
aixtools/vault/__init__.py,sha256=fsr_NuX3GZ9WZ7dGfe0gp_5-z3URxAfwVRXw7Xyc0dU,141
|
|
91
91
|
aixtools/vault/vault.py,sha256=9dZLWdZQk9qN_Q9Djkofw9LUKnJqnrX5H0fGusVLBhA,6037
|
|
92
|
-
aixtools-0.2.
|
|
93
|
-
aixtools-0.2.
|
|
94
|
-
aixtools-0.2.
|
|
95
|
-
aixtools-0.2.
|
|
96
|
-
aixtools-0.2.
|
|
92
|
+
aixtools-0.2.15.dist-info/METADATA,sha256=pMsq-5JO6i7tEE3rfFNwk2zD70H7qLLc8fzo1zObSTI,27230
|
|
93
|
+
aixtools-0.2.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
94
|
+
aixtools-0.2.15.dist-info/entry_points.txt,sha256=q8412TG4T0S8K0SKeWp2vkVPIDYQs0jNoHqcQ7qxOiA,155
|
|
95
|
+
aixtools-0.2.15.dist-info/top_level.txt,sha256=wBn-rw9bCtxrR4AYEYgjilNCUVmKY0LWby9Zan2PRJM,9
|
|
96
|
+
aixtools-0.2.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|